(0.2ms) BEGIN  (1.3ms) ROLLBACK  (0.9ms) BEGIN  (0.3ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 39ms (Views: 29.0ms | ActiveRecord: 0.0ms)  (1.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Completed 500 Internal Server Error in 32ms (ActiveRecord: 3.9ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Completed 500 Internal Server Error in 3ms (ActiveRecord: 2.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.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 11ms (Views: 10.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) 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 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.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 1ms (ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (1.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (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-06-21 14:40:25.399771"], ["updated_at", "2019-06-21 14:40:25.399771"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:40:25.419645"], ["id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:40:25.426401"], ["updated_at", "2019-06-21 14:40:25.426401"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561214425"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) 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-06-21 14:40:25.450304"], ["updated_at", "2019-06-21 14:40:25.450304"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:40:25.458818"], ["updated_at", "2019-06-21 14:40:25.458818"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561041625"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.464155"], ["updated_at", "2019-06-21 14:40:25.464155"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 3], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-21 14:40:25.492329"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:25.496493"], ["updated_at", "2019-06-21 14:40:25.496493"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:25.499036"], ["updated_at", "2019-06-21 14:40:25.499036"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:25.501236"], ["updated_at", "2019-06-21 14:40:25.501236"], ["synced_id", 1], ["host", "example2.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:25.504347"], ["updated_at", "2019-06-21 14:40:25.504347"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.509425"], ["updated_at", "2019-06-21 14:40:25.509425"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.513387"], ["updated_at", "2019-06-21 14:40:25.513387"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.518189"], ["updated_at", "2019-06-21 14:40:25.518189"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.523920"], ["updated_at", "2019-06-21 14:40:25.523920"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.526155"], ["updated_at", "2019-06-21 14:40:25.526155"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.532091"], ["updated_at", "2019-06-21 14:40:25.532091"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.534406"], ["updated_at", "2019-06-21 14:40:25.534406"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.540900"], ["updated_at", "2019-06-21 14:40:25.540900"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:40:25.544692"], ["updated_at", "2019-06-21 14:40:25.544692"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.548784"], ["updated_at", "2019-06-21 14:40:25.548784"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:40:25.552178"], ["updated_at", "2019-06-21 14:40:25.552178"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 17], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:40:25.555841"], ["id", 17]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.560619"], ["updated_at", "2019-06-21 14:40:25.560619"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.563190"], ["updated_at", "2019-06-21 14:40:25.563190"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 19], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:40:25.566131"], ["id", 19]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 19], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:40:25.571107"], ["updated_at", "2019-06-21 14:40:25.571107"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.573809"], ["updated_at", "2019-06-21 14:40:25.573809"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 21], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:40:25.577665"], ["id", 21]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 21], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.582276"], ["updated_at", "2019-06-21 14:40:25.582276"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.584591"], ["updated_at", "2019-06-21 14:40:25.584591"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:25.591548"], ["updated_at", "2019-06-21 14:40:25.591548"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.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-06-21 14:40:25.599183"], ["updated_at", "2019-06-21 14:40:25.599183"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:25.609929"], ["updated_at", "2019-06-21 14:40:25.609929"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.616688"], ["updated_at", "2019-06-21 14:40:25.616688"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.620122"], ["updated_at", "2019-06-21 14:40:25.620122"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:25.624593"], ["updated_at", "2019-06-21 14:40:25.624593"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.628973"], ["updated_at", "2019-06-21 14:40:25.628973"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:40:25.649695"], ["updated_at", "2019-06-21 14:40:25.649695"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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 (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:40:25.666169"], ["updated_at", "2019-06-21 14:40:25.666169"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.671430"], ["updated_at", "2019-06-21 14:40:25.671430"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.714299"], ["updated_at", "2019-06-21 14:40:25.714299"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.730789"], ["updated_at", "2019-06-21 14:40:25.730789"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.748374"], ["updated_at", "2019-06-21 14:40:25.748374"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.757234"], ["updated_at", "2019-06-21 14:40:25.757234"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.771043"], ["updated_at", "2019-06-21 14:40:25.771043"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.784684"], ["updated_at", "2019-06-21 14:40:25.784684"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:40:25.793613"], ["updated_at", "2019-06-21 14:40:25.793613"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 5ms (Views: 4.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:25.847247"], ["updated_at", "2019-06-21 14:40:25.847247"], ["synced_id", 123], ["host", "example.host"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:25.853937"], ["updated_at", "2019-06-21 14:40:25.853937"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.3ms) ROLLBACK  (0.6ms) BEGIN  (0.2ms) 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.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:40:25.879132"], ["updated_at", "2019-06-21 14:40:25.879132"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:40:25.891043"], ["updated_at", "2019-06-21 14:40:25.891043"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:40:25.898269"], ["updated_at", "2019-06-21 14:40:25.898269"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:40:25.911177"], ["updated_at", "2019-06-21 14:40:25.911177"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:40:25.920670"], ["updated_at", "2019-06-21 14:40:25.920670"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 19ms (Views: 11.0ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 14:40:25.957940"], ["updated_at", "2019-06-21 14:40:25.957940"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:40:25.962876"], ["updated_at", "2019-06-21 14:40:25.962876"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561041625"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 6], ["LIMIT", 1]] Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 14:40:25.985878"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 6]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:40:25.993749"], ["updated_at", "2019-06-21 14:40:25.993749"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561214425"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:40:25.997590"], ["updated_at", "2019-06-21 14:40:25.997590"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.016477"], ["updated_at", "2019-06-21 14:40:26.016477"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.019168"], ["updated_at", "2019-06-21 14:40:26.019168"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 10], ["LIMIT", 1]] Account Update (0.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-06-21 14:40:26.022654"], ["id", 10]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 10], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.028029"], ["updated_at", "2019-06-21 14:40:26.028029"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.029977"], ["updated_at", "2019-06-21 14:40:26.029977"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 12], ["LIMIT", 1]] Account Update (0.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-06-21 14:40:26.032485"], ["id", 12]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 12], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.037345"], ["updated_at", "2019-06-21 14:40:26.037345"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.039326"], ["updated_at", "2019-06-21 14:40:26.039326"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 14], ["LIMIT", 1]] Account Update (0.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-06-21 14:40:26.042694"], ["id", 14]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.046554"], ["updated_at", "2019-06-21 14:40:26.046554"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.048396"], ["updated_at", "2019-06-21 14:40:26.048396"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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 (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-06-21 14:40:26.052265"], ["id", 16]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.057083"], ["updated_at", "2019-06-21 14:40:26.057083"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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.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-06-21 14:40:26.061465"], ["updated_at", "2019-06-21 14:40:26.061465"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.065450"], ["updated_at", "2019-06-21 14:40:26.065450"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:40:26.069131"], ["updated_at", "2019-06-21 14:40:26.069131"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.072712"], ["updated_at", "2019-06-21 14:40:26.072712"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:40:26.075502"], ["updated_at", "2019-06-21 14:40:26.075502"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:40:26.079482"], ["updated_at", "2019-06-21 14:40:26.079482"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:40:26.082056"], ["updated_at", "2019-06-21 14:40:26.082056"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:40:26.085899"], ["updated_at", "2019-06-21 14:40:26.085899"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:40:26.089823"], ["updated_at", "2019-06-21 14:40:26.089823"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:40:26.092075"], ["updated_at", "2019-06-21 14:40:26.092075"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:40:26.094528"], ["updated_at", "2019-06-21 14:40:26.094528"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 14:40:26.103139"], ["updated_at", "2019-06-21 14:40:26.103139"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 14:40:26.105104"], ["synced_id", 0], ["id", 29]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:40:26.112596"], ["updated_at", "2019-06-21 14:40:26.112596"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 14:40:26.116277"], ["updated_at", "2019-06-21 14:40:26.116277"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 31], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 31], ["LIMIT", 1]] Account Update (0.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-06-21 14:40:26.120349"], ["id", 31]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 31], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (1.6ms) BEGIN  (0.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.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.556989"], ["updated_at", "2019-06-21 14:42:23.556989"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.573723"], ["updated_at", "2019-06-21 14:42:23.573723"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.582623"], ["updated_at", "2019-06-21 14:42:23.582623"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.593368"], ["updated_at", "2019-06-21 14:42:23.593368"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.613636"], ["updated_at", "2019-06-21 14:42:23.613636"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.628561"], ["updated_at", "2019-06-21 14:42:23.628561"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.653745"], ["updated_at", "2019-06-21 14:42:23.653745"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.657258"], ["updated_at", "2019-06-21 14:42:23.657258"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.660589"], ["updated_at", "2019-06-21 14:42:23.660589"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.666397"], ["updated_at", "2019-06-21 14:42:23.666397"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.670660"], ["updated_at", "2019-06-21 14:42:23.670660"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.693653"], ["updated_at", "2019-06-21 14:42:23.693653"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.697047"], ["updated_at", "2019-06-21 14:42:23.697047"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.702584"], ["updated_at", "2019-06-21 14:42:23.702584"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 36], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 36], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:42:23.710630"], ["id", 36]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 36], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.715842"], ["updated_at", "2019-06-21 14:42:23.715842"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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 (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.730376"], ["updated_at", "2019-06-21 14:42:23.730376"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.747454"], ["updated_at", "2019-06-21 14:42:23.747454"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.749954"], ["updated_at", "2019-06-21 14:42:23.749954"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.753026"], ["updated_at", "2019-06-21 14:42:23.753026"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.755195"], ["updated_at", "2019-06-21 14:42:23.755195"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:42:23.760283"], ["updated_at", "2019-06-21 14:42:23.760283"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561041743"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.763541"], ["updated_at", "2019-06-21 14:42:23.763541"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 42], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-21 14:42:23.779824"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 42]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:42:23.783823"], ["updated_at", "2019-06-21 14:42:23.783823"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561214543"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.787652"], ["updated_at", "2019-06-21 14:42:23.787652"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:42:23.792403"], ["updated_at", "2019-06-21 14:42:23.792403"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.795517"], ["updated_at", "2019-06-21 14:42:23.795517"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 44], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:42:23.798750"], ["id", 44]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.803719"], ["updated_at", "2019-06-21 14:42:23.803719"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.805645"], ["updated_at", "2019-06-21 14:42:23.805645"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 46], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:42:23.808804"], ["id", 46]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 46], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.813863"], ["updated_at", "2019-06-21 14:42:23.813863"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.815939"], ["updated_at", "2019-06-21 14:42:23.815939"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 48], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:42:23.819562"], ["id", 48]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 48], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:42:23.823948"], ["updated_at", "2019-06-21 14:42:23.823948"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.826290"], ["updated_at", "2019-06-21 14:42:23.826290"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.829984"], ["updated_at", "2019-06-21 14:42:23.829984"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.835616"], ["updated_at", "2019-06-21 14:42:23.835616"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.837817"], ["updated_at", "2019-06-21 14:42:23.837817"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.842208"], ["updated_at", "2019-06-21 14:42:23.842208"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.844298"], ["updated_at", "2019-06-21 14:42:23.844298"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.848511"], ["updated_at", "2019-06-21 14:42:23.848511"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.851761"], ["updated_at", "2019-06-21 14:42:23.851761"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.855221"], ["updated_at", "2019-06-21 14:42:23.855221"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.857351"], ["updated_at", "2019-06-21 14:42:23.857351"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.862217"], ["updated_at", "2019-06-21 14:42:23.862217"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 17ms (Views: 11.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:42:23.922835"], ["updated_at", "2019-06-21 14:42:23.922835"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 15ms (ActiveRecord: 3.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:42:23.929243"], ["updated_at", "2019-06-21 14:42:23.929243"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:42:23.937018"], ["updated_at", "2019-06-21 14:42:23.937018"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:42:23.946046"], ["updated_at", "2019-06-21 14:42:23.946046"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:42:23.957040"], ["updated_at", "2019-06-21 14:42:23.957040"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.964435"], ["updated_at", "2019-06-21 14:42:23.964435"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.966763"], ["updated_at", "2019-06-21 14:42:23.966763"], ["synced_id", 123], ["host", "test.host"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:42:23.973219"], ["updated_at", "2019-06-21 14:42:23.973219"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.978104"], ["updated_at", "2019-06-21 14:42:23.978104"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:42:23.981182"], ["updated_at", "2019-06-21 14:42:23.981182"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.985538"], ["updated_at", "2019-06-21 14:42:23.985538"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:42:23.988307"], ["updated_at", "2019-06-21 14:42:23.988307"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.991612"], ["updated_at", "2019-06-21 14:42:23.991612"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:42:23.994402"], ["updated_at", "2019-06-21 14:42:23.994402"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:23.997845"], ["updated_at", "2019-06-21 14:42:23.997845"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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.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-06-21 14:42:24.002089"], ["updated_at", "2019-06-21 14:42:24.002089"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:24.006517"], ["updated_at", "2019-06-21 14:42:24.006517"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-21 14:42:24.008618"], ["updated_at", "2019-06-21 14:42:24.008618"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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.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-06-21 14:42:24.012769"], ["id", 45]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:24.016296"], ["updated_at", "2019-06-21 14:42:24.016296"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:24.018634"], ["updated_at", "2019-06-21 14:42:24.018634"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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 (0.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-06-21 14:42:24.021867"], ["id", 47]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 47], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:24.025965"], ["updated_at", "2019-06-21 14:42:24.025965"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:24.027937"], ["updated_at", "2019-06-21 14:42:24.027937"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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.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-06-21 14:42:24.030380"], ["id", 49]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 49], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:24.036720"], ["updated_at", "2019-06-21 14:42:24.036720"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:42:24.039019"], ["updated_at", "2019-06-21 14:42:24.039019"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 51], ["LIMIT", 1]] Account Update (0.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-06-21 14:42:24.043407"], ["id", 51]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 14:42:24.047573"], ["updated_at", "2019-06-21 14:42:24.047573"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 52], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 52], ["LIMIT", 1]] Account Update (0.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-06-21 14:42:24.050647"], ["id", 52]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 52], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 14:42:24.062130"], ["updated_at", "2019-06-21 14:42:24.062130"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 14:42:24.063713"], ["synced_id", 0], ["id", 53]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:42:24.072646"], ["updated_at", "2019-06-21 14:42:24.072646"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 14:42:24.076019"], ["updated_at", "2019-06-21 14:42:24.076019"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:42:24.079712"], ["updated_at", "2019-06-21 14:42:24.079712"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:42:24.097155"], ["updated_at", "2019-06-21 14:42:24.097155"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:42:24.101326"], ["updated_at", "2019-06-21 14:42:24.101326"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561214544"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:42:24.105783"], ["updated_at", "2019-06-21 14:42:24.105783"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561041744"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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 (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 14:42:24.123908"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 59]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:42:24.129579"], ["updated_at", "2019-06-21 14:42:24.129579"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:42:24.131763"], ["updated_at", "2019-06-21 14:42:24.131763"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:42:24.133730"], ["updated_at", "2019-06-21 14:42:24.133730"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) 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 6ms (Views: 4.5ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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-06-21 14:48:16.174365"], ["updated_at", "2019-06-21 14:48:16.174365"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 65], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 65], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:48:16.186045"], ["id", 65]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 65], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.193452"], ["updated_at", "2019-06-21 14:48:16.193452"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:16.197711"], ["updated_at", "2019-06-21 14:48:16.197711"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.199863"], ["updated_at", "2019-06-21 14:48:16.199863"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) 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"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.204679"], ["updated_at", "2019-06-21 14:48:16.204679"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.210379"], ["updated_at", "2019-06-21 14:48:16.210379"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.212803"], ["updated_at", "2019-06-21 14:48:16.212803"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.218641"], ["updated_at", "2019-06-21 14:48:16.218641"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.222409"], ["updated_at", "2019-06-21 14:48:16.222409"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.226863"], ["updated_at", "2019-06-21 14:48:16.226863"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.228926"], ["updated_at", "2019-06-21 14:48:16.228926"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:16.233249"], ["updated_at", "2019-06-21 14:48:16.233249"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:16.236276"], ["updated_at", "2019-06-21 14:48:16.236276"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 76], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:48:16.240137"], ["id", 76]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:16.245004"], ["updated_at", "2019-06-21 14:48:16.245004"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.247071"], ["updated_at", "2019-06-21 14:48:16.247071"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 78], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:48:16.250347"], ["id", 78]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 78], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:16.256389"], ["updated_at", "2019-06-21 14:48:16.256389"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.258911"], ["updated_at", "2019-06-21 14:48:16.258911"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 80], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:48:16.262138"], ["id", 80]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 80], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.266641"], ["updated_at", "2019-06-21 14:48:16.266641"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.268932"], ["updated_at", "2019-06-21 14:48:16.268932"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.275413"], ["updated_at", "2019-06-21 14:48:16.275413"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.279519"], ["updated_at", "2019-06-21 14:48:16.279519"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.283022"], ["updated_at", "2019-06-21 14:48:16.283022"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.289145"], ["updated_at", "2019-06-21 14:48:16.289145"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.292118"], ["updated_at", "2019-06-21 14:48:16.292118"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.294251"], ["updated_at", "2019-06-21 14:48:16.294251"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.296275"], ["updated_at", "2019-06-21 14:48:16.296275"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.301045"], ["updated_at", "2019-06-21 14:48:16.301045"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.306494"], ["updated_at", "2019-06-21 14:48:16.306494"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:16.334521"], ["updated_at", "2019-06-21 14:48:16.334521"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.4ms) 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.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.353766"], ["updated_at", "2019-06-21 14:48:16.353766"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:16.377803"], ["updated_at", "2019-06-21 14:48:16.377803"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561214896"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.382366"], ["updated_at", "2019-06-21 14:48:16.382366"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 14:48:16.387628"], ["updated_at", "2019-06-21 14:48:16.387628"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561042096"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.391526"], ["updated_at", "2019-06-21 14:48:16.391526"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 92], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:48:16.408889"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 92]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.413332"], ["updated_at", "2019-06-21 14:48:16.413332"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.416535"], ["updated_at", "2019-06-21 14:48:16.416535"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.423398"], ["updated_at", "2019-06-21 14:48:16.423398"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.439448"], ["updated_at", "2019-06-21 14:48:16.439448"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.441779"], ["updated_at", "2019-06-21 14:48:16.441779"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:16.466262"], ["updated_at", "2019-06-21 14:48:16.466262"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:16.478951"], ["updated_at", "2019-06-21 14:48:16.478951"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:16.487853"], ["updated_at", "2019-06-21 14:48:16.487853"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:16.495802"], ["updated_at", "2019-06-21 14:48:16.495802"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:16.506853"], ["updated_at", "2019-06-21 14:48:16.506853"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 17ms (Views: 10.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.547830"], ["updated_at", "2019-06-21 14:48:16.547830"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.564029"], ["updated_at", "2019-06-21 14:48:16.564029"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.576022"], ["updated_at", "2019-06-21 14:48:16.576022"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) 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.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.584752"], ["updated_at", "2019-06-21 14:48:16.584752"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.597222"], ["updated_at", "2019-06-21 14:48:16.597222"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:16.611656"], ["updated_at", "2019-06-21 14:48:16.611656"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.627117"], ["updated_at", "2019-06-21 14:48:16.627117"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.629143"], ["updated_at", "2019-06-21 14:48:16.629143"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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-06-21 14:48:16.632013"], ["id", 68]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.635973"], ["updated_at", "2019-06-21 14:48:16.635973"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.639119"], ["updated_at", "2019-06-21 14:48:16.639119"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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.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-06-21 14:48:16.642154"], ["id", 70]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.645565"], ["updated_at", "2019-06-21 14:48:16.645565"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.647571"], ["updated_at", "2019-06-21 14:48:16.647571"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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-06-21 14:48:16.650160"], ["id", 72]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 72], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.655715"], ["updated_at", "2019-06-21 14:48:16.655715"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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-06-21 14:48:16.657822"], ["updated_at", "2019-06-21 14:48:16.657822"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 74], ["LIMIT", 1]] Account Update (0.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-06-21 14:48:16.660857"], ["id", 74]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 74], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.664948"], ["updated_at", "2019-06-21 14:48:16.664948"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:16.667953"], ["updated_at", "2019-06-21 14:48:16.667953"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.672832"], ["updated_at", "2019-06-21 14:48:16.672832"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:16.675685"], ["updated_at", "2019-06-21 14:48:16.675685"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.679186"], ["updated_at", "2019-06-21 14:48:16.679186"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:16.681679"], ["updated_at", "2019-06-21 14:48:16.681679"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:16.684874"], ["updated_at", "2019-06-21 14:48:16.684874"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:16.689179"], ["updated_at", "2019-06-21 14:48:16.689179"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:16.693001"], ["updated_at", "2019-06-21 14:48:16.693001"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:16.696287"], ["updated_at", "2019-06-21 14:48:16.696287"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:16.699222"], ["updated_at", "2019-06-21 14:48:16.699222"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:16.701617"], ["updated_at", "2019-06-21 14:48:16.701617"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:16.705302"], ["updated_at", "2019-06-21 14:48:16.705302"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 14:48:16.713921"], ["updated_at", "2019-06-21 14:48:16.713921"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 14:48:16.715606"], ["synced_id", 0], ["id", 88]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:16.724678"], ["updated_at", "2019-06-21 14:48:16.724678"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561042096"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 14:48:16.741148"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 89]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:16.745205"], ["updated_at", "2019-06-21 14:48:16.745205"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561214896"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 14:48:16.748984"], ["updated_at", "2019-06-21 14:48:16.748984"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 91], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 91], ["LIMIT", 1]] Account Update (0.5ms) 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-06-21 14:48:16.752728"], ["id", 91]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 91], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 14:48:16.758042"], ["updated_at", "2019-06-21 14:48:16.758042"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:16.762622"], ["updated_at", "2019-06-21 14:48:16.762622"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.283252"], ["updated_at", "2019-06-21 14:48:42.283252"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.286121"], ["updated_at", "2019-06-21 14:48:42.286121"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:42.306996"], ["updated_at", "2019-06-21 14:48:42.306996"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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.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-06-21 14:48:42.315580"], ["updated_at", "2019-06-21 14:48:42.315580"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.325025"], ["updated_at", "2019-06-21 14:48:42.325025"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 100], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 100], ["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-06-21 14:48:42.329923"], ["id", 100]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 100], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:42.337469"], ["updated_at", "2019-06-21 14:48:42.337469"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561214922"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.351028"], ["updated_at", "2019-06-21 14:48:42.351028"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:42.357360"], ["updated_at", "2019-06-21 14:48:42.357360"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561042122"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.360662"], ["updated_at", "2019-06-21 14:48:42.360662"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 102], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-21 14:48:42.390917"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 102]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.394940"], ["updated_at", "2019-06-21 14:48:42.394940"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.397976"], ["updated_at", "2019-06-21 14:48:42.397976"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.401178"], ["updated_at", "2019-06-21 14:48:42.401178"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.406135"], ["updated_at", "2019-06-21 14:48:42.406135"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:42.411062"], ["updated_at", "2019-06-21 14:48:42.411062"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.427503"], ["updated_at", "2019-06-21 14:48:42.427503"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.431029"], ["updated_at", "2019-06-21 14:48:42.431029"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.434700"], ["updated_at", "2019-06-21 14:48:42.434700"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.3ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.440331"], ["updated_at", "2019-06-21 14:48:42.440331"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.442549"], ["updated_at", "2019-06-21 14:48:42.442549"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.447954"], ["updated_at", "2019-06-21 14:48:42.447954"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.450251"], ["updated_at", "2019-06-21 14:48:42.450251"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.455183"], ["updated_at", "2019-06-21 14:48:42.455183"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.457313"], ["updated_at", "2019-06-21 14:48:42.457313"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 14:48:42.463955"], ["updated_at", "2019-06-21 14:48:42.463955"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.466302"], ["updated_at", "2019-06-21 14:48:42.466302"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 117], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:48:42.469093"], ["id", 117]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:42.474128"], ["updated_at", "2019-06-21 14:48:42.474128"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.476309"], ["updated_at", "2019-06-21 14:48:42.476309"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 119], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:48:42.480012"], ["id", 119]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 119], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.484308"], ["updated_at", "2019-06-21 14:48:42.484308"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.486436"], ["updated_at", "2019-06-21 14:48:42.486436"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) 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"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 121], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:48:42.490038"], ["id", 121]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 121], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:48:42.494639"], ["updated_at", "2019-06-21 14:48:42.494639"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.497305"], ["updated_at", "2019-06-21 14:48:42.497305"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.503048"], ["updated_at", "2019-06-21 14:48:42.503048"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.507055"], ["updated_at", "2019-06-21 14:48:42.507055"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.510051"], ["updated_at", "2019-06-21 14:48:42.510051"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.515625"], ["updated_at", "2019-06-21 14:48:42.515625"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.519292"], ["updated_at", "2019-06-21 14:48:42.519292"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.525524"], ["updated_at", "2019-06-21 14:48:42.525524"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.550431"], ["updated_at", "2019-06-21 14:48:42.550431"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.553679"], ["updated_at", "2019-06-21 14:48:42.553679"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:42.581981"], ["updated_at", "2019-06-21 14:48:42.581981"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561042122"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 14:48:42.600045"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 95]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:42.604373"], ["updated_at", "2019-06-21 14:48:42.604373"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561214922"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:42.607960"], ["updated_at", "2019-06-21 14:48:42.607960"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:42.624411"], ["updated_at", "2019-06-21 14:48:42.624411"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 14:48:42.628187"], ["updated_at", "2019-06-21 14:48:42.628187"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:42.632761"], ["updated_at", "2019-06-21 14:48:42.632761"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:42.634577"], ["updated_at", "2019-06-21 14:48:42.634577"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:42.636435"], ["updated_at", "2019-06-21 14:48:42.636435"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.642343"], ["updated_at", "2019-06-21 14:48:42.642343"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:42.647611"], ["updated_at", "2019-06-21 14:48:42.647611"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.651951"], ["updated_at", "2019-06-21 14:48:42.651951"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:42.655932"], ["updated_at", "2019-06-21 14:48:42.655932"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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-06-21 14:48:42.659650"], ["updated_at", "2019-06-21 14:48:42.659650"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:42.664497"], ["updated_at", "2019-06-21 14:48:42.664497"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.668082"], ["updated_at", "2019-06-21 14:48:42.668082"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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.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-06-21 14:48:42.671274"], ["updated_at", "2019-06-21 14:48:42.671274"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.674856"], ["updated_at", "2019-06-21 14:48:42.674856"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.676703"], ["updated_at", "2019-06-21 14:48:42.676703"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 112], ["LIMIT", 1]] Account Update (0.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-06-21 14:48:42.680552"], ["id", 112]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.684432"], ["updated_at", "2019-06-21 14:48:42.684432"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.686402"], ["updated_at", "2019-06-21 14:48:42.686402"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 114], ["LIMIT", 1]] Account Update (0.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-06-21 14:48:42.689692"], ["id", 114]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 114], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.694429"], ["updated_at", "2019-06-21 14:48:42.694429"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.696996"], ["updated_at", "2019-06-21 14:48:42.696996"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 116], ["LIMIT", 1]] Account Update (0.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-06-21 14:48:42.699595"], ["id", 116]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 116], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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-06-21 14:48:42.703772"], ["updated_at", "2019-06-21 14:48:42.703772"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:48:42.706155"], ["updated_at", "2019-06-21 14:48:42.706155"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 118], ["LIMIT", 1]] Account Update (0.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-06-21 14:48:42.708807"], ["id", 118]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 14:48:42.716275"], ["updated_at", "2019-06-21 14:48:42.716275"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 14:48:42.717725"], ["synced_id", 0], ["id", 119]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 14:48:42.723775"], ["updated_at", "2019-06-21 14:48:42.723775"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 120], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 120], ["LIMIT", 1]] Account Update (0.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-06-21 14:48:42.726620"], ["id", 120]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 120], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:48:42.732073"], ["updated_at", "2019-06-21 14:48:42.732073"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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.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-06-21 14:48:42.739050"], ["updated_at", "2019-06-21 14:48:42.739050"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:42.746161"], ["updated_at", "2019-06-21 14:48:42.746161"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:48:42.755698"], ["updated_at", "2019-06-21 14:48:42.755698"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:48:42.764975"], ["updated_at", "2019-06-21 14:48:42.764975"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 21ms (Views: 12.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.803725"], ["updated_at", "2019-06-21 14:48:42.803725"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.813646"], ["updated_at", "2019-06-21 14:48:42.813646"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.821412"], ["updated_at", "2019-06-21 14:48:42.821412"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.835175"], ["updated_at", "2019-06-21 14:48:42.835175"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.844019"], ["updated_at", "2019-06-21 14:48:42.844019"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.859144"], ["updated_at", "2019-06-21 14:48:42.859144"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:48:42.900438"], ["updated_at", "2019-06-21 14:48:42.900438"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (2.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.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-06-21 14:49:11.232781"], ["updated_at", "2019-06-21 14:49:11.232781"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.276059"], ["updated_at", "2019-06-21 14:49:11.276059"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 14:49:11.285260"], ["updated_at", "2019-06-21 14:49:11.285260"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.290661"], ["updated_at", "2019-06-21 14:49:11.290661"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:49:11.294703"], ["updated_at", "2019-06-21 14:49:11.294703"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.299038"], ["updated_at", "2019-06-21 14:49:11.299038"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:49:11.302115"], ["updated_at", "2019-06-21 14:49:11.302115"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.307031"], ["updated_at", "2019-06-21 14:49:11.307031"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:49:11.309799"], ["updated_at", "2019-06-21 14:49:11.309799"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.316511"], ["updated_at", "2019-06-21 14:49:11.316511"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.319540"], ["updated_at", "2019-06-21 14:49:11.319540"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 134], ["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-06-21 14:49:11.324197"], ["id", 134]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.329404"], ["updated_at", "2019-06-21 14:49:11.329404"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.332103"], ["updated_at", "2019-06-21 14:49:11.332103"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 136], ["LIMIT", 1]] Account Update (0.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-06-21 14:49:11.336161"], ["id", 136]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.341004"], ["updated_at", "2019-06-21 14:49:11.341004"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.343174"], ["updated_at", "2019-06-21 14:49:11.343174"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 138], ["LIMIT", 1]] Account Update (0.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-06-21 14:49:11.345884"], ["id", 138]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 138], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.351850"], ["updated_at", "2019-06-21 14:49:11.351850"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.354053"], ["updated_at", "2019-06-21 14:49:11.354053"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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-06-21 14:49:11.357324"], ["id", 140]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 140], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:49:11.362268"], ["updated_at", "2019-06-21 14:49:11.362268"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:49:11.392713"], ["updated_at", "2019-06-21 14:49:11.392713"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 14:49:11.397004"], ["updated_at", "2019-06-21 14:49:11.397004"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 143], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 143], ["LIMIT", 1]] Account Update (0.2ms) 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-06-21 14:49:11.402099"], ["id", 143]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 143], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:49:11.406721"], ["updated_at", "2019-06-21 14:49:11.406721"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:49:11.428506"], ["updated_at", "2019-06-21 14:49:11.428506"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561214951"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:49:11.432649"], ["updated_at", "2019-06-21 14:49:11.432649"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561042151"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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 (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 14:49:11.449292"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 146]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 14:49:11.452863"], ["updated_at", "2019-06-21 14:49:11.452863"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 14:49:11.460489"], ["updated_at", "2019-06-21 14:49:11.460489"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 14:49:11.462203"], ["synced_id", 0], ["id", 148]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:49:11.471865"], ["updated_at", "2019-06-21 14:49:11.471865"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:49:11.474359"], ["updated_at", "2019-06-21 14:49:11.474359"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:49:11.476078"], ["updated_at", "2019-06-21 14:49:11.476078"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 14:49:11.489073"], ["updated_at", "2019-06-21 14:49:11.489073"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.510787"], ["updated_at", "2019-06-21 14:49:11.510787"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.513177"], ["updated_at", "2019-06-21 14:49:11.513177"], ["synced_id", 123], ["host", "test.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.519939"], ["updated_at", "2019-06-21 14:49:11.519939"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.524506"], ["updated_at", "2019-06-21 14:49:11.524506"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.527798"], ["updated_at", "2019-06-21 14:49:11.527798"], ["synced_id", 2], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.531660"], ["updated_at", "2019-06-21 14:49:11.531660"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.534205"], ["updated_at", "2019-06-21 14:49:11.534205"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.539003"], ["updated_at", "2019-06-21 14:49:11.539003"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.542405"], ["updated_at", "2019-06-21 14:49:11.542405"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.561072"], ["updated_at", "2019-06-21 14:49:11.561072"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.566912"], ["updated_at", "2019-06-21 14:49:11.566912"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.570860"], ["updated_at", "2019-06-21 14:49:11.570860"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.575759"], ["updated_at", "2019-06-21 14:49:11.575759"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561214951"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.578904"], ["updated_at", "2019-06-21 14:49:11.578904"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:49:11.584480"], ["updated_at", "2019-06-21 14:49:11.584480"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561042151"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) 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.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.588322"], ["updated_at", "2019-06-21 14:49:11.588322"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 139], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-21 14:49:11.603894"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 139]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.609344"], ["updated_at", "2019-06-21 14:49:11.609344"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 140], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 140], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:49:11.617486"], ["id", 140]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 140], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.625947"], ["updated_at", "2019-06-21 14:49:11.625947"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.628019"], ["updated_at", "2019-06-21 14:49:11.628019"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.632995"], ["updated_at", "2019-06-21 14:49:11.632995"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.638575"], ["updated_at", "2019-06-21 14:49:11.638575"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.640968"], ["updated_at", "2019-06-21 14:49:11.640968"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.645111"], ["updated_at", "2019-06-21 14:49:11.645111"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:49:11.647812"], ["updated_at", "2019-06-21 14:49:11.647812"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.652625"], ["updated_at", "2019-06-21 14:49:11.652625"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.654901"], ["updated_at", "2019-06-21 14:49:11.654901"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.659343"], ["updated_at", "2019-06-21 14:49:11.659343"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.661311"], ["updated_at", "2019-06-21 14:49:11.661311"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 150], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:49:11.665619"], ["id", 150]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.669660"], ["updated_at", "2019-06-21 14:49:11.669660"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.672238"], ["updated_at", "2019-06-21 14:49:11.672238"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 152], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:49:11.675820"], ["id", 152]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 152], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:49:11.680565"], ["updated_at", "2019-06-21 14:49:11.680565"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.683740"], ["updated_at", "2019-06-21 14:49:11.683740"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 154], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 14:49:11.686864"], ["id", 154]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 154], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.692120"], ["updated_at", "2019-06-21 14:49:11.692120"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.694185"], ["updated_at", "2019-06-21 14:49:11.694185"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 14:49:11.700064"], ["updated_at", "2019-06-21 14:49:11.700064"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 14:49:11.709815"], ["updated_at", "2019-06-21 14:49:11.709815"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.713002"], ["updated_at", "2019-06-21 14:49:11.713002"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.716831"], ["updated_at", "2019-06-21 14:49:11.716831"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:49:11.724872"], ["updated_at", "2019-06-21 14:49:11.724872"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:49:11.735982"], ["updated_at", "2019-06-21 14:49:11.735982"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 14:49:11.749848"], ["updated_at", "2019-06-21 14:49:11.749848"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 14:49:11.758574"], ["updated_at", "2019-06-21 14:49:11.758574"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 18ms (Views: 11.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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: 0.8ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.814583"], ["updated_at", "2019-06-21 14:49:11.814583"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.823744"], ["updated_at", "2019-06-21 14:49:11.823744"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.831593"], ["updated_at", "2019-06-21 14:49:11.831593"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.845030"], ["updated_at", "2019-06-21 14:49:11.845030"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.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 Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.871008"], ["updated_at", "2019-06-21 14:49:11.871008"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 14:49:11.880048"], ["updated_at", "2019-06-21 14:49:11.880048"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["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-06-21 15:06:45.136512"], ["updated_at", "2019-06-21 15:06:45.136512"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:06:45.184110"], ["updated_at", "2019-06-21 15:06:45.184110"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216005"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:06:45.188836"], ["updated_at", "2019-06-21 15:06:45.188836"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:06:45.193946"], ["updated_at", "2019-06-21 15:06:45.193946"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561043205"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-21 15:06:45.197651"], ["updated_at", "2019-06-21 15:06:45.197651"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 162], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) 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-06-21 15:06:45.227141"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 162]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.232179"], ["updated_at", "2019-06-21 15:06:45.232179"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:06:45.236214"], ["updated_at", "2019-06-21 15:06:45.236214"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:06:45.241055"], ["updated_at", "2019-06-21 15:06:45.241055"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.245733"], ["updated_at", "2019-06-21 15:06:45.245733"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.257855"], ["updated_at", "2019-06-21 15:06:45.257855"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:06:45.261579"], ["updated_at", "2019-06-21 15:06:45.261579"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:06:45.270795"], ["updated_at", "2019-06-21 15:06:45.270795"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.275489"], ["updated_at", "2019-06-21 15:06:45.275489"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.282794"], ["updated_at", "2019-06-21 15:06:45.282794"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.286874"], ["updated_at", "2019-06-21 15:06:45.286874"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.292356"], ["updated_at", "2019-06-21 15:06:45.292356"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.299580"], ["updated_at", "2019-06-21 15:06:45.299580"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.301856"], ["updated_at", "2019-06-21 15:06:45.301856"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.308572"], ["updated_at", "2019-06-21 15:06:45.308572"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.310675"], ["updated_at", "2019-06-21 15:06:45.310675"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.318061"], ["updated_at", "2019-06-21 15:06:45.318061"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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 (0.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-06-21 15:06:45.322199"], ["updated_at", "2019-06-21 15:06:45.322199"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-21 15:06:45.327807"], ["updated_at", "2019-06-21 15:06:45.327807"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:06:45.333000"], ["updated_at", "2019-06-21 15:06:45.333000"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (1.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", 177], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:06:45.340864"], ["id", 177]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.346817"], ["updated_at", "2019-06-21 15:06:45.346817"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:06:45.351271"], ["updated_at", "2019-06-21 15:06:45.351271"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 179], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:06:45.355497"], ["id", 179]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 179], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.359958"], ["updated_at", "2019-06-21 15:06:45.359958"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:06:45.363596"], ["updated_at", "2019-06-21 15:06:45.363596"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 181], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:06:45.367014"], ["id", 181]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 181], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.372265"], ["updated_at", "2019-06-21 15:06:45.372265"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 183], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 183], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:06:45.375464"], ["id", 183]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 183], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:06:45.381004"], ["updated_at", "2019-06-21 15:06:45.381004"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.396323"], ["updated_at", "2019-06-21 15:06:45.396323"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.399040"], ["updated_at", "2019-06-21 15:06:45.399040"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.401220"], ["updated_at", "2019-06-21 15:06:45.401220"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.403400"], ["updated_at", "2019-06-21 15:06:45.403400"], ["synced_id", 2], ["host", "example2.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.408713"], ["updated_at", "2019-06-21 15:06:45.408713"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-21 15:06:45.411973"], ["updated_at", "2019-06-21 15:06:45.411973"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.3ms) 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 (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:06:45.477489"], ["updated_at", "2019-06-21 15:06:45.477489"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.489996"], ["updated_at", "2019-06-21 15:06:45.489996"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.492438"], ["updated_at", "2019-06-21 15:06:45.492438"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:06:45.519590"], ["updated_at", "2019-06-21 15:06:45.519590"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:06:45.527900"], ["updated_at", "2019-06-21 15:06:45.527900"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.1ms) 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"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.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", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-21 15:06:45.542940"], ["updated_at", "2019-06-21 15:06:45.542940"], ["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.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 4.6ms)  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:06:45.558771"], ["updated_at", "2019-06-21 15:06:45.558771"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 29ms (Views: 20.7ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:06:45.617329"], ["updated_at", "2019-06-21 15:06:45.617329"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:06:45.631855"], ["updated_at", "2019-06-21 15:06:45.631855"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:06:45.639610"], ["updated_at", "2019-06-21 15:06:45.639610"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:06:45.649225"], ["updated_at", "2019-06-21 15:06:45.649225"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:06:45.662211"], ["updated_at", "2019-06-21 15:06:45.662211"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:06:45.675869"], ["updated_at", "2019-06-21 15:06:45.675869"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:06:45.705343"], ["updated_at", "2019-06-21 15:06:45.705343"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:06:45.716936"], ["updated_at", "2019-06-21 15:06:45.716936"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:06:45.721337"], ["updated_at", "2019-06-21 15:06:45.721337"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:06:45.725143"], ["updated_at", "2019-06-21 15:06:45.725143"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 162], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 162], ["LIMIT", 1]] Account Update (0.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-06-21 15:06:45.730281"], ["id", 162]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 162], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:06:45.735849"], ["updated_at", "2019-06-21 15:06:45.735849"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:06:45.738085"], ["updated_at", "2019-06-21 15:06:45.738085"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:06:45.739939"], ["updated_at", "2019-06-21 15:06:45.739939"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) 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 (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:06:45.746190"], ["updated_at", "2019-06-21 15:06:45.746190"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.770608"], ["updated_at", "2019-06-21 15:06:45.770608"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.772648"], ["updated_at", "2019-06-21 15:06:45.772648"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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.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-06-21 15:06:45.775719"], ["id", 168]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 168], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.780111"], ["updated_at", "2019-06-21 15:06:45.780111"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.782183"], ["updated_at", "2019-06-21 15:06:45.782183"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 170], ["LIMIT", 1]] Account Update (0.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-06-21 15:06:45.789874"], ["id", 170]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 170], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.794956"], ["updated_at", "2019-06-21 15:06:45.794956"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.797416"], ["updated_at", "2019-06-21 15:06:45.797416"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 172], ["LIMIT", 1]] Account Update (0.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-06-21 15:06:45.802439"], ["id", 172]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) 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.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.809259"], ["updated_at", "2019-06-21 15:06:45.809259"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.812544"], ["updated_at", "2019-06-21 15:06:45.812544"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 174], ["LIMIT", 1]] Account Update (0.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-06-21 15:06:45.816003"], ["id", 174]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.819568"], ["updated_at", "2019-06-21 15:06:45.819568"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:06:45.822733"], ["updated_at", "2019-06-21 15:06:45.822733"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.826623"], ["updated_at", "2019-06-21 15:06:45.826623"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:06:45.829934"], ["updated_at", "2019-06-21 15:06:45.829934"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.835861"], ["updated_at", "2019-06-21 15:06:45.835861"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:06:45.838920"], ["updated_at", "2019-06-21 15:06:45.838920"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:06:45.841990"], ["updated_at", "2019-06-21 15:06:45.841990"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:06:45.844747"], ["updated_at", "2019-06-21 15:06:45.844747"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:06:45.854990"], ["updated_at", "2019-06-21 15:06:45.854990"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:06:45.856603"], ["synced_id", 0], ["id", 183]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:06:45.866553"], ["updated_at", "2019-06-21 15:06:45.866553"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216005"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:06:45.871655"], ["updated_at", "2019-06-21 15:06:45.871655"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561043205"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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 (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:06:45.889383"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 185]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:06:45.892821"], ["updated_at", "2019-06-21 15:06:45.892821"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:08:34.577141"], ["updated_at", "2019-06-21 15:08:34.577141"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one 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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:34.598642"], ["updated_at", "2019-06-21 15:08:34.598642"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:34.601297"], ["updated_at", "2019-06-21 15:08:34.601297"], ["synced_id", 123], ["host", "test.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:34.608888"], ["updated_at", "2019-06-21 15:08:34.608888"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:34.611449"], ["updated_at", "2019-06-21 15:08:34.611449"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:34.613936"], ["updated_at", "2019-06-21 15:08:34.613936"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:34.616286"], ["updated_at", "2019-06-21 15:08:34.616286"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.622412"], ["updated_at", "2019-06-21 15:08:34.622412"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561043314"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:34.636927"], ["updated_at", "2019-06-21 15:08:34.636927"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) 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", 199], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.5ms) 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-06-21 15:08:34.682746"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 199]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:08:34.689073"], ["updated_at", "2019-06-21 15:08:34.689073"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216114"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) 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.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:34.695690"], ["updated_at", "2019-06-21 15:08:34.695690"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) 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.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:34.706313"], ["updated_at", "2019-06-21 15:08:34.706313"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:34.722123"], ["updated_at", "2019-06-21 15:08:34.722123"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:34.728263"], ["updated_at", "2019-06-21 15:08:34.728263"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:08:34.734006"], ["updated_at", "2019-06-21 15:08:34.734006"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.736673"], ["updated_at", "2019-06-21 15:08:34.736673"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.746107"], ["updated_at", "2019-06-21 15:08:34.746107"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.748628"], ["updated_at", "2019-06-21 15:08:34.748628"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 204], ["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-06-21 15:08:34.753240"], ["id", 204]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:08:34.764172"], ["updated_at", "2019-06-21 15:08:34.764172"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.766586"], ["updated_at", "2019-06-21 15:08:34.766586"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 206], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:08:34.770187"], ["id", 206]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 206], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.774151"], ["updated_at", "2019-06-21 15:08:34.774151"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.776860"], ["updated_at", "2019-06-21 15:08:34.776860"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 208], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:08:34.780911"], ["id", 208]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 208], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-21 15:08:34.785459"], ["updated_at", "2019-06-21 15:08:34.785459"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.788927"], ["updated_at", "2019-06-21 15:08:34.788927"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) 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.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-06-21 15:08:34.796503"], ["updated_at", "2019-06-21 15:08:34.796503"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.801643"], ["updated_at", "2019-06-21 15:08:34.801643"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.804052"], ["updated_at", "2019-06-21 15:08:34.804052"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.809701"], ["updated_at", "2019-06-21 15:08:34.809701"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.811799"], ["updated_at", "2019-06-21 15:08:34.811799"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.815598"], ["updated_at", "2019-06-21 15:08:34.815598"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.817741"], ["updated_at", "2019-06-21 15:08:34.817741"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:34.821274"], ["updated_at", "2019-06-21 15:08:34.821274"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:34.824434"], ["updated_at", "2019-06-21 15:08:34.824434"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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.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-06-21 15:08:34.844363"], ["updated_at", "2019-06-21 15:08:34.844363"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.859468"], ["updated_at", "2019-06-21 15:08:34.859468"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.865345"], ["updated_at", "2019-06-21 15:08:34.865345"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) 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", 222], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 222], ["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-06-21 15:08:34.869814"], ["id", 222]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 222], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:34.876787"], ["updated_at", "2019-06-21 15:08:34.876787"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:34.880546"], ["updated_at", "2019-06-21 15:08:34.880546"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:34.883763"], ["updated_at", "2019-06-21 15:08:34.883763"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:08:34.894677"], ["updated_at", "2019-06-21 15:08:34.894677"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:08:34.900988"], ["updated_at", "2019-06-21 15:08:34.900988"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:08:34.911625"], ["updated_at", "2019-06-21 15:08:34.911625"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:08:34.923320"], ["updated_at", "2019-06-21 15:08:34.923320"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 20ms (Views: 12.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:34.979033"], ["updated_at", "2019-06-21 15:08:34.979033"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:08:34.983500"], ["updated_at", "2019-06-21 15:08:34.983500"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:08:34.985610"], ["updated_at", "2019-06-21 15:08:34.985610"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:08:34.988426"], ["updated_at", "2019-06-21 15:08:34.988426"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:08:34.993201"], ["updated_at", "2019-06-21 15:08:34.993201"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561043314"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 194], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:08:35.012498"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 194]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:08:35.017146"], ["updated_at", "2019-06-21 15:08:35.017146"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216115"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:35.021958"], ["updated_at", "2019-06-21 15:08:35.021958"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:35.024463"], ["updated_at", "2019-06-21 15:08:35.024463"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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-06-21 15:08:35.027512"], ["id", 197]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:35.036276"], ["updated_at", "2019-06-21 15:08:35.036276"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:35.039137"], ["updated_at", "2019-06-21 15:08:35.039137"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) 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.1ms) 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", 199], ["LIMIT", 1]] Account Update (0.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-06-21 15:08:35.044053"], ["id", 199]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:35.052157"], ["updated_at", "2019-06-21 15:08:35.052157"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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-06-21 15:08:35.058549"], ["updated_at", "2019-06-21 15:08:35.058549"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 201], ["LIMIT", 1]] Account Update (0.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-06-21 15:08:35.064098"], ["id", 201]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 201], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:35.068989"], ["updated_at", "2019-06-21 15:08:35.068989"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:35.071806"], ["updated_at", "2019-06-21 15:08:35.071806"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 203], ["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-06-21 15:08:35.077773"], ["id", 203]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 203], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:35.083277"], ["updated_at", "2019-06-21 15:08:35.083277"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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 (0.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-06-21 15:08:35.089469"], ["updated_at", "2019-06-21 15:08:35.089469"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:35.094520"], ["updated_at", "2019-06-21 15:08:35.094520"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:08:35.097229"], ["updated_at", "2019-06-21 15:08:35.097229"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:35.100650"], ["updated_at", "2019-06-21 15:08:35.100650"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:08:35.103614"], ["updated_at", "2019-06-21 15:08:35.103614"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:08:35.108039"], ["updated_at", "2019-06-21 15:08:35.108039"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:08:35.111334"], ["updated_at", "2019-06-21 15:08:35.111334"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:08:35.114684"], ["updated_at", "2019-06-21 15:08:35.114684"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:08:35.133700"], ["updated_at", "2019-06-21 15:08:35.133700"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:08:35.139119"], ["updated_at", "2019-06-21 15:08:35.139119"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:08:35.143478"], ["updated_at", "2019-06-21 15:08:35.143478"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 215], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 215], ["LIMIT", 1]] Account Update (0.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-06-21 15:08:35.146908"], ["id", 215]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 215], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:08:35.156553"], ["updated_at", "2019-06-21 15:08:35.156553"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:08:35.158464"], ["synced_id", 0], ["id", 216]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:08:35.164512"], ["updated_at", "2019-06-21 15:08:35.164512"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.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.5ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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: 0.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.7ms) 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-06-21 15:08:35.189530"], ["updated_at", "2019-06-21 15:08:35.189530"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:35.203361"], ["updated_at", "2019-06-21 15:08:35.203361"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:35.214039"], ["updated_at", "2019-06-21 15:08:35.214039"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:35.227805"], ["updated_at", "2019-06-21 15:08:35.227805"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:35.235305"], ["updated_at", "2019-06-21 15:08:35.235305"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:08:35.248625"], ["updated_at", "2019-06-21 15:08:35.248625"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.471047"], ["updated_at", "2019-06-21 15:12:50.471047"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.474860"], ["updated_at", "2019-06-21 15:12:50.474860"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:12:50.494147"], ["updated_at", "2019-06-21 15:12:50.494147"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 20ms (Views: 12.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:12:50.530631"], ["updated_at", "2019-06-21 15:12:50.530631"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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.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-06-21 15:12:50.539057"], ["updated_at", "2019-06-21 15:12:50.539057"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:12:50.548723"], ["updated_at", "2019-06-21 15:12:50.548723"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.559559"], ["updated_at", "2019-06-21 15:12:50.559559"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 2ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:12:50.576772"], ["updated_at", "2019-06-21 15:12:50.576772"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 222], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 222], ["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-06-21 15:12:50.583169"], ["id", 222]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 222], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:12:50.593431"], ["updated_at", "2019-06-21 15:12:50.593431"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:12:50.627583"], ["updated_at", "2019-06-21 15:12:50.627583"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:12:50.629426"], ["updated_at", "2019-06-21 15:12:50.629426"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:12:50.631186"], ["updated_at", "2019-06-21 15:12:50.631186"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:12:50.636056"], ["updated_at", "2019-06-21 15:12:50.636056"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561043570"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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 (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:12:50.651443"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 227]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:12:50.656932"], ["updated_at", "2019-06-21 15:12:50.656932"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216370"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:12:50.660135"], ["updated_at", "2019-06-21 15:12:50.660135"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:12:50.681921"], ["updated_at", "2019-06-21 15:12:50.681921"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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-06-21 15:12:50.683927"], ["updated_at", "2019-06-21 15:12:50.683927"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:12:50.687298"], ["updated_at", "2019-06-21 15:12:50.687298"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:12:50.692014"], ["updated_at", "2019-06-21 15:12:50.692014"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:12:50.698293"], ["updated_at", "2019-06-21 15:12:50.698293"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:12:50.699733"], ["synced_id", 0], ["id", 234]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:12:50.712136"], ["updated_at", "2019-06-21 15:12:50.712136"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.717168"], ["updated_at", "2019-06-21 15:12:50.717168"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.719860"], ["updated_at", "2019-06-21 15:12:50.719860"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 237], ["LIMIT", 1]] Account Update (0.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-06-21 15:12:50.723702"], ["id", 237]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.728076"], ["updated_at", "2019-06-21 15:12:50.728076"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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 (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.735825"], ["updated_at", "2019-06-21 15:12:50.735825"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 239], ["LIMIT", 1]] Account Update (0.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-06-21 15:12:50.739129"], ["id", 239]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 239], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.743365"], ["updated_at", "2019-06-21 15:12:50.743365"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.745529"], ["updated_at", "2019-06-21 15:12:50.745529"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 241], ["LIMIT", 1]] Account Update (0.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-06-21 15:12:50.748248"], ["id", 241]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 241], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.752949"], ["updated_at", "2019-06-21 15:12:50.752949"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.756697"], ["updated_at", "2019-06-21 15:12:50.756697"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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", 243], ["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-06-21 15:12:50.763281"], ["id", 243]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.769206"], ["updated_at", "2019-06-21 15:12:50.769206"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:12:50.774455"], ["updated_at", "2019-06-21 15:12:50.774455"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.778659"], ["updated_at", "2019-06-21 15:12:50.778659"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:12:50.781175"], ["updated_at", "2019-06-21 15:12:50.781175"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.784351"], ["updated_at", "2019-06-21 15:12:50.784351"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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.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-06-21 15:12:50.788899"], ["updated_at", "2019-06-21 15:12:50.788899"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.792808"], ["updated_at", "2019-06-21 15:12:50.792808"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:12:50.795519"], ["updated_at", "2019-06-21 15:12:50.795519"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.5ms) ROLLBACK  (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.834297"], ["updated_at", "2019-06-21 15:12:50.834297"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:50.841211"], ["updated_at", "2019-06-21 15:12:50.841211"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:50.844735"], ["updated_at", "2019-06-21 15:12:50.844735"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.850733"], ["updated_at", "2019-06-21 15:12:50.850733"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) 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 (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.863430"], ["updated_at", "2019-06-21 15:12:50.863430"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.865875"], ["updated_at", "2019-06-21 15:12:50.865875"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.869379"], ["updated_at", "2019-06-21 15:12:50.869379"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.871777"], ["updated_at", "2019-06-21 15:12:50.871777"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.876676"], ["updated_at", "2019-06-21 15:12:50.876676"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.878609"], ["updated_at", "2019-06-21 15:12:50.878609"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.880463"], ["updated_at", "2019-06-21 15:12:50.880463"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:50.882609"], ["updated_at", "2019-06-21 15:12:50.882609"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.887390"], ["updated_at", "2019-06-21 15:12:50.887390"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) 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", 238], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 238], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:12:50.891277"], ["id", 238]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 238], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.895786"], ["updated_at", "2019-06-21 15:12:50.895786"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561043570"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:50.898902"], ["updated_at", "2019-06-21 15:12:50.898902"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 239], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-21 15:12:50.916220"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 239]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.920418"], ["updated_at", "2019-06-21 15:12:50.920418"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216370"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (5.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:50.929388"], ["updated_at", "2019-06-21 15:12:50.929388"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.934163"], ["updated_at", "2019-06-21 15:12:50.934163"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.940722"], ["updated_at", "2019-06-21 15:12:50.940722"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:50.945139"], ["updated_at", "2019-06-21 15:12:50.945139"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "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.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-06-21 15:12:50.953198"], ["updated_at", "2019-06-21 15:12:50.953198"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.960125"], ["updated_at", "2019-06-21 15:12:50.960125"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.962260"], ["updated_at", "2019-06-21 15:12:50.962260"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.966956"], ["updated_at", "2019-06-21 15:12:50.966956"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-21 15:12:50.971038"], ["updated_at", "2019-06-21 15:12:50.971038"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.5ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.977377"], ["updated_at", "2019-06-21 15:12:50.977377"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.979734"], ["updated_at", "2019-06-21 15:12:50.979734"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_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-06-21 15:12:50.985157"], ["updated_at", "2019-06-21 15:12:50.985157"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.988653"], ["updated_at", "2019-06-21 15:12:50.988653"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) 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"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 251], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:12:50.992641"], ["id", 251]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:12:50.996703"], ["updated_at", "2019-06-21 15:12:50.996703"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:50.999248"], ["updated_at", "2019-06-21 15:12:50.999248"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 253], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:12:51.003735"], ["id", 253]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 253], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:51.008394"], ["updated_at", "2019-06-21 15:12:51.008394"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:51.010593"], ["updated_at", "2019-06-21 15:12:51.010593"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 255], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:12:51.013472"], ["id", 255]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 255], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:51.018629"], ["updated_at", "2019-06-21 15:12:51.018629"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:12:51.021382"], ["updated_at", "2019-06-21 15:12:51.021382"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:51.027486"], ["updated_at", "2019-06-21 15:12:51.027486"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:51.030565"], ["updated_at", "2019-06-21 15:12:51.030565"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:51.048884"], ["updated_at", "2019-06-21 15:12:51.048884"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:12:51.054919"], ["updated_at", "2019-06-21 15:12:51.054919"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:51.058674"], ["updated_at", "2019-06-21 15:12:51.058674"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:51.063685"], ["updated_at", "2019-06-21 15:12:51.063685"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:51.079191"], ["updated_at", "2019-06-21 15:12:51.079191"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:51.093094"], ["updated_at", "2019-06-21 15:12:51.093094"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:51.101225"], ["updated_at", "2019-06-21 15:12:51.101225"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) 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-06-21 15:12:51.117735"], ["updated_at", "2019-06-21 15:12:51.117735"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:51.128220"], ["updated_at", "2019-06-21 15:12:51.128220"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:12:51.146015"], ["updated_at", "2019-06-21 15:12:51.146015"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) 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.2ms) SAVEPOINT active_record_1 Account Exists (0.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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:13:17.558546"], ["updated_at", "2019-06-21 15:13:17.558546"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 51ms (ActiveRecord: 10.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:13:17.566667"], ["updated_at", "2019-06-21 15:13:17.566667"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:13:17.577262"], ["updated_at", "2019-06-21 15:13:17.577262"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) 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"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) 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", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-21 15:13:17.603100"], ["updated_at", "2019-06-21 15:13:17.603100"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 3.5ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 20ms (Views: 13.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:13:17.638853"], ["updated_at", "2019-06-21 15:13:17.638853"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:13:17.640889"], ["updated_at", "2019-06-21 15:13:17.640889"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:13:17.643354"], ["updated_at", "2019-06-21 15:13:17.643354"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.647628"], ["updated_at", "2019-06-21 15:13:17.647628"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.649583"], ["updated_at", "2019-06-21 15:13:17.649583"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 259], ["LIMIT", 1]] Account Update (0.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-06-21 15:13:17.654823"], ["id", 259]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.659957"], ["updated_at", "2019-06-21 15:13:17.659957"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.661882"], ["updated_at", "2019-06-21 15:13:17.661882"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 261], ["LIMIT", 1]] Account Update (0.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-06-21 15:13:17.664480"], ["id", 261]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 261], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.670137"], ["updated_at", "2019-06-21 15:13:17.670137"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.672386"], ["updated_at", "2019-06-21 15:13:17.672386"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 263], ["LIMIT", 1]] Account Update (0.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-06-21 15:13:17.676577"], ["id", 263]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 263], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.681215"], ["updated_at", "2019-06-21 15:13:17.681215"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.683314"], ["updated_at", "2019-06-21 15:13:17.683314"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 265], ["LIMIT", 1]] Account Update (0.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-06-21 15:13:17.687564"], ["id", 265]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.692732"], ["updated_at", "2019-06-21 15:13:17.692732"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:13:17.696152"], ["updated_at", "2019-06-21 15:13:17.696152"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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-06-21 15:13:17.700066"], ["updated_at", "2019-06-21 15:13:17.700066"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:13:17.704115"], ["updated_at", "2019-06-21 15:13:17.704115"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.708427"], ["updated_at", "2019-06-21 15:13:17.708427"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:13:17.710900"], ["updated_at", "2019-06-21 15:13:17.710900"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.714447"], ["updated_at", "2019-06-21 15:13:17.714447"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:13:17.717068"], ["updated_at", "2019-06-21 15:13:17.717068"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:13:17.721849"], ["updated_at", "2019-06-21 15:13:17.721849"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:13:17.748889"], ["updated_at", "2019-06-21 15:13:17.748889"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561043597"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 275], ["LIMIT", 1]] Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:13:17.764781"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 275]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:13:17.771012"], ["updated_at", "2019-06-21 15:13:17.771012"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216397"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:13:17.775284"], ["updated_at", "2019-06-21 15:13:17.775284"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:13:17.779569"], ["updated_at", "2019-06-21 15:13:17.779569"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:13:17.782788"], ["updated_at", "2019-06-21 15:13:17.782788"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:13:17.789207"], ["updated_at", "2019-06-21 15:13:17.789207"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 280], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 280], ["LIMIT", 1]] Account Update (0.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-06-21 15:13:17.793455"], ["id", 280]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 280], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:13:17.803204"], ["updated_at", "2019-06-21 15:13:17.803204"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:13:17.805271"], ["synced_id", 0], ["id", 281]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:13:17.818485"], ["updated_at", "2019-06-21 15:13:17.818485"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:13:17.820692"], ["updated_at", "2019-06-21 15:13:17.820692"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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-06-21 15:13:17.823337"], ["updated_at", "2019-06-21 15:13:17.823337"], ["synced_id", 3]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:17.859689"], ["updated_at", "2019-06-21 15:13:17.859689"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.876934"], ["updated_at", "2019-06-21 15:13:17.876934"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:17.879302"], ["updated_at", "2019-06-21 15:13:17.879302"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:13:17.886200"], ["updated_at", "2019-06-21 15:13:17.886200"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.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.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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  (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.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:17.938182"], ["updated_at", "2019-06-21 15:13:17.938182"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:17.953095"], ["updated_at", "2019-06-21 15:13:17.953095"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) 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.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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-21 15:13:17.975876"], ["updated_at", "2019-06-21 15:13:17.975876"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:17.997356"], ["updated_at", "2019-06-21 15:13:17.997356"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (2.0ms) BEGIN  (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:18.013033"], ["updated_at", "2019-06-21 15:13:18.013033"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:18.032623"], ["updated_at", "2019-06-21 15:13:18.032623"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:18.051362"], ["updated_at", "2019-06-21 15:13:18.051362"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:18.054775"], ["updated_at", "2019-06-21 15:13:18.054775"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:18.059720"], ["updated_at", "2019-06-21 15:13:18.059720"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:13:18.064840"], ["updated_at", "2019-06-21 15:13:18.064840"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:18.077404"], ["updated_at", "2019-06-21 15:13:18.077404"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:18.079988"], ["updated_at", "2019-06-21 15:13:18.079988"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:18.082165"], ["updated_at", "2019-06-21 15:13:18.082165"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:18.084431"], ["updated_at", "2019-06-21 15:13:18.084431"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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-06-21 15:13:18.089991"], ["updated_at", "2019-06-21 15:13:18.089991"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.093992"], ["updated_at", "2019-06-21 15:13:18.093992"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:13:18.099882"], ["updated_at", "2019-06-21 15:13:18.099882"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.102208"], ["updated_at", "2019-06-21 15:13:18.102208"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.106530"], ["updated_at", "2019-06-21 15:13:18.106530"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.3ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.113430"], ["updated_at", "2019-06-21 15:13:18.113430"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.115992"], ["updated_at", "2019-06-21 15:13:18.115992"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.121284"], ["updated_at", "2019-06-21 15:13:18.121284"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-21 15:13:18.126748"], ["updated_at", "2019-06-21 15:13:18.126748"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.132705"], ["updated_at", "2019-06-21 15:13:18.132705"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.135212"], ["updated_at", "2019-06-21 15:13:18.135212"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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-06-21 15:13:18.139696"], ["updated_at", "2019-06-21 15:13:18.139696"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.143478"], ["updated_at", "2019-06-21 15:13:18.143478"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 281], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:13:18.146933"], ["id", 281]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:13:18.151120"], ["updated_at", "2019-06-21 15:13:18.151120"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.153294"], ["updated_at", "2019-06-21 15:13:18.153294"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 283], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:13:18.157456"], ["id", 283]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 283], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.163526"], ["updated_at", "2019-06-21 15:13:18.163526"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.165747"], ["updated_at", "2019-06-21 15:13:18.165747"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 285], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:13:18.169008"], ["id", 285]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 285], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:18.175137"], ["updated_at", "2019-06-21 15:13:18.175137"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:18.178841"], ["updated_at", "2019-06-21 15:13:18.178841"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.197637"], ["updated_at", "2019-06-21 15:13:18.197637"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:18.202159"], ["updated_at", "2019-06-21 15:13:18.202159"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:18.205634"], ["updated_at", "2019-06-21 15:13:18.205634"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:13:18.211936"], ["updated_at", "2019-06-21 15:13:18.211936"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561043598"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:18.216953"], ["updated_at", "2019-06-21 15:13:18.216953"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 290], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-21 15:13:18.234785"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 290]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:13:18.242012"], ["updated_at", "2019-06-21 15:13:18.242012"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216398"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:18.245826"], ["updated_at", "2019-06-21 15:13:18.245826"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:13:18.250625"], ["updated_at", "2019-06-21 15:13:18.250625"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 292], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 292], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:13:18.253709"], ["id", 292]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 292], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:13:18.261363"], ["updated_at", "2019-06-21 15:13:18.261363"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:18.266993"], ["updated_at", "2019-06-21 15:13:18.266993"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:18.268998"], ["updated_at", "2019-06-21 15:13:18.268998"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:18.271042"], ["updated_at", "2019-06-21 15:13:18.271042"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:13:18.274420"], ["updated_at", "2019-06-21 15:13:18.274420"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:21:46.612523"], ["updated_at", "2019-06-21 15:21:46.612523"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.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.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-06-21 15:21:46.633987"], ["updated_at", "2019-06-21 15:21:46.633987"], ["synced_id", 123], ["host", "example.host"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.639308"], ["updated_at", "2019-06-21 15:21:46.639308"], ["synced_id", 123], ["host", "test.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.4ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.692008"], ["updated_at", "2019-06-21 15:21:46.692008"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.694236"], ["updated_at", "2019-06-21 15:21:46.694236"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.696524"], ["updated_at", "2019-06-21 15:21:46.696524"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.699595"], ["updated_at", "2019-06-21 15:21:46.699595"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:21:46.704857"], ["updated_at", "2019-06-21 15:21:46.704857"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.708159"], ["updated_at", "2019-06-21 15:21:46.708159"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-21 15:21:46.714380"], ["updated_at", "2019-06-21 15:21:46.714380"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.717510"], ["updated_at", "2019-06-21 15:21:46.717510"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 305], ["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-06-21 15:21:46.721574"], ["id", 305]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.727761"], ["updated_at", "2019-06-21 15:21:46.727761"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.729769"], ["updated_at", "2019-06-21 15:21:46.729769"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 307], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:21:46.733495"], ["id", 307]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 307], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:21:46.738280"], ["updated_at", "2019-06-21 15:21:46.738280"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.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-06-21 15:21:46.741210"], ["updated_at", "2019-06-21 15:21:46.741210"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 309], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:21:46.744193"], ["id", 309]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 309], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.748601"], ["updated_at", "2019-06-21 15:21:46.748601"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.751534"], ["updated_at", "2019-06-21 15:21:46.751534"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.758832"], ["updated_at", "2019-06-21 15:21:46.758832"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.763370"], ["updated_at", "2019-06-21 15:21:46.763370"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:21:46.767094"], ["updated_at", "2019-06-21 15:21:46.767094"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.773465"], ["updated_at", "2019-06-21 15:21:46.773465"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.775854"], ["updated_at", "2019-06-21 15:21:46.775854"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.780601"], ["updated_at", "2019-06-21 15:21:46.780601"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.783379"], ["updated_at", "2019-06-21 15:21:46.783379"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:46.790259"], ["updated_at", "2019-06-21 15:21:46.790259"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.816963"], ["updated_at", "2019-06-21 15:21:46.816963"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:46.820795"], ["updated_at", "2019-06-21 15:21:46.820795"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:46.825073"], ["updated_at", "2019-06-21 15:21:46.825073"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.829670"], ["updated_at", "2019-06-21 15:21:46.829670"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.837021"], ["updated_at", "2019-06-21 15:21:46.837021"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) 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", 322], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 322], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:21:46.841943"], ["id", 322]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 322], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.846203"], ["updated_at", "2019-06-21 15:21:46.846203"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:46.850354"], ["updated_at", "2019-06-21 15:21:46.850354"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:21:46.875334"], ["updated_at", "2019-06-21 15:21:46.875334"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.890078"], ["updated_at", "2019-06-21 15:21:46.890078"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:21:46.919810"], ["updated_at", "2019-06-21 15:21:46.919810"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216906"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:46.924114"], ["updated_at", "2019-06-21 15:21:46.924114"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:21:46.928543"], ["updated_at", "2019-06-21 15:21:46.928543"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044106"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) 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-06-21 15:21:46.931846"], ["updated_at", "2019-06-21 15:21:46.931846"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 327], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) 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-06-21 15:21:46.950127"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 327]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.954706"], ["updated_at", "2019-06-21 15:21:46.954706"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:46.959364"], ["updated_at", "2019-06-21 15:21:46.959364"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.963695"], ["updated_at", "2019-06-21 15:21:46.963695"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.967133"], ["updated_at", "2019-06-21 15:21:46.967133"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.969867"], ["updated_at", "2019-06-21 15:21:46.969867"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:46.972483"], ["updated_at", "2019-06-21 15:21:46.972483"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:46.978450"], ["updated_at", "2019-06-21 15:21:46.978450"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:46.992419"], ["updated_at", "2019-06-21 15:21:46.992419"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:47.004444"], ["updated_at", "2019-06-21 15:21:47.004444"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:47.021007"], ["updated_at", "2019-06-21 15:21:47.021007"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:47.028292"], ["updated_at", "2019-06-21 15:21:47.028292"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:47.040335"], ["updated_at", "2019-06-21 15:21:47.040335"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:21:47.057540"], ["updated_at", "2019-06-21 15:21:47.057540"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:21:47.061958"], ["updated_at", "2019-06-21 15:21:47.061958"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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-06-21 15:21:47.066719"], ["updated_at", "2019-06-21 15:21:47.066719"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:47.070330"], ["updated_at", "2019-06-21 15:21:47.070330"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 289], ["LIMIT", 1]] Account Update (0.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-06-21 15:21:47.073295"], ["id", 289]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 289], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:47.079043"], ["updated_at", "2019-06-21 15:21:47.079043"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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-06-21 15:21:47.081906"], ["updated_at", "2019-06-21 15:21:47.081906"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 291], ["LIMIT", 1]] Account Update (0.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-06-21 15:21:47.087514"], ["id", 291]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 291], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:47.093096"], ["updated_at", "2019-06-21 15:21:47.093096"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:47.095430"], ["updated_at", "2019-06-21 15:21:47.095430"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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 (0.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-06-21 15:21:47.099213"], ["id", 293]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:47.104778"], ["updated_at", "2019-06-21 15:21:47.104778"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:47.106793"], ["updated_at", "2019-06-21 15:21:47.106793"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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.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-06-21 15:21:47.109395"], ["id", 295]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:47.112701"], ["updated_at", "2019-06-21 15:21:47.112701"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:21:47.117087"], ["updated_at", "2019-06-21 15:21:47.117087"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:47.121654"], ["updated_at", "2019-06-21 15:21:47.121654"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:21:47.124126"], ["updated_at", "2019-06-21 15:21:47.124126"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:47.127355"], ["updated_at", "2019-06-21 15:21:47.127355"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:21:47.129843"], ["updated_at", "2019-06-21 15:21:47.129843"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:21:47.133782"], ["updated_at", "2019-06-21 15:21:47.133782"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:21:47.137304"], ["updated_at", "2019-06-21 15:21:47.137304"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:21:47.140623"], ["updated_at", "2019-06-21 15:21:47.140623"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:21:47.144267"], ["updated_at", "2019-06-21 15:21:47.144267"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:21:47.146245"], ["updated_at", "2019-06-21 15:21:47.146245"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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-06-21 15:21:47.148965"], ["updated_at", "2019-06-21 15:21:47.148965"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:21:47.156864"], ["updated_at", "2019-06-21 15:21:47.156864"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 308], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 308], ["LIMIT", 1]] Account Update (0.2ms) 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-06-21 15:21:47.160370"], ["id", 308]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 308], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-06-21 15:21:47.166600"], ["updated_at", "2019-06-21 15:21:47.166600"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216907"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:21:47.173501"], ["updated_at", "2019-06-21 15:21:47.173501"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044107"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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 (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:21:47.189780"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 310]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:21:47.193003"], ["updated_at", "2019-06-21 15:21:47.193003"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:21:47.210366"], ["updated_at", "2019-06-21 15:21:47.210366"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:21:47.214556"], ["updated_at", "2019-06-21 15:21:47.214556"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:21:47.218753"], ["updated_at", "2019-06-21 15:21:47.218753"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:21:47.221292"], ["updated_at", "2019-06-21 15:21:47.221292"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:21:47.231068"], ["updated_at", "2019-06-21 15:21:47.231068"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:21:47.234591"], ["synced_id", 0], ["id", 316]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:21:47.253496"], ["updated_at", "2019-06-21 15:21:47.253496"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:21:47.265191"], ["updated_at", "2019-06-21 15:21:47.265191"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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-06-21 15:21:47.276526"], ["updated_at", "2019-06-21 15:21:47.276526"], ["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.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 1.9ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:21:47.292647"], ["updated_at", "2019-06-21 15:21:47.292647"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 19ms (Views: 10.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) 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-06-21 15:22:48.678381"], ["updated_at", "2019-06-21 15:22:48.678381"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-21 15:22:48.691976"], ["updated_at", "2019-06-21 15:22:48.691976"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:22:48.709563"], ["updated_at", "2019-06-21 15:22:48.709563"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:22:48.727395"], ["updated_at", "2019-06-21 15:22:48.727395"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:22:48.741391"], ["updated_at", "2019-06-21 15:22:48.741391"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) 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-06-21 15:22:48.755308"], ["updated_at", "2019-06-21 15:22:48.755308"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:22:48.778865"], ["updated_at", "2019-06-21 15:22:48.778865"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:22:48.781356"], ["updated_at", "2019-06-21 15:22:48.781356"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:22:48.783311"], ["updated_at", "2019-06-21 15:22:48.783311"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:22:48.806775"], ["updated_at", "2019-06-21 15:22:48.806775"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:22:48.811001"], ["updated_at", "2019-06-21 15:22:48.811001"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 324], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 324], ["LIMIT", 1]] Account Update (0.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-06-21 15:22:48.819256"], ["id", 324]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 324], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.825740"], ["updated_at", "2019-06-21 15:22:48.825740"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:22:48.829551"], ["updated_at", "2019-06-21 15:22:48.829551"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.834001"], ["updated_at", "2019-06-21 15:22:48.834001"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:22:48.836766"], ["updated_at", "2019-06-21 15:22:48.836766"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.842422"], ["updated_at", "2019-06-21 15:22:48.842422"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:22:48.846055"], ["updated_at", "2019-06-21 15:22:48.846055"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.850000"], ["updated_at", "2019-06-21 15:22:48.850000"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:22:48.852628"], ["updated_at", "2019-06-21 15:22:48.852628"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.857611"], ["updated_at", "2019-06-21 15:22:48.857611"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.860857"], ["updated_at", "2019-06-21 15:22:48.860857"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 334], ["LIMIT", 1]] Account Update (0.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-06-21 15:22:48.864096"], ["id", 334]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.868547"], ["updated_at", "2019-06-21 15:22:48.868547"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.870421"], ["updated_at", "2019-06-21 15:22:48.870421"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 336], ["LIMIT", 1]] Account Update (0.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-06-21 15:22:48.874015"], ["id", 336]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 336], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.878640"], ["updated_at", "2019-06-21 15:22:48.878640"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.880662"], ["updated_at", "2019-06-21 15:22:48.880662"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 338], ["LIMIT", 1]] Account Update (0.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-06-21 15:22:48.883852"], ["id", 338]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 338], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.887933"], ["updated_at", "2019-06-21 15:22:48.887933"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:48.890709"], ["updated_at", "2019-06-21 15:22:48.890709"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 340], ["LIMIT", 1]] Account Update (0.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-06-21 15:22:48.893453"], ["id", 340]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:22:48.897923"], ["updated_at", "2019-06-21 15:22:48.897923"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044168"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 341], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:22:48.918119"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 341]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:22:48.921849"], ["updated_at", "2019-06-21 15:22:48.921849"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216968"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:22:48.928632"], ["updated_at", "2019-06-21 15:22:48.928632"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:22:48.930295"], ["synced_id", 0], ["id", 343]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:22:48.936302"], ["updated_at", "2019-06-21 15:22:48.936302"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:22:48.939437"], ["updated_at", "2019-06-21 15:22:48.939437"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:22:48.944259"], ["updated_at", "2019-06-21 15:22:48.944259"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:22:48.960965"], ["updated_at", "2019-06-21 15:22:48.960965"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:22:48.962850"], ["updated_at", "2019-06-21 15:22:48.962850"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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-06-21 15:22:48.965014"], ["updated_at", "2019-06-21 15:22:48.965014"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:22:49.011347"], ["updated_at", "2019-06-21 15:22:49.011347"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:22:49.017817"], ["updated_at", "2019-06-21 15:22:49.017817"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-21 15:22:49.046416"], ["updated_at", "2019-06-21 15:22:49.046416"], ["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.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 24ms (ActiveRecord: 4.0ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:22:49.059000"], ["updated_at", "2019-06-21 15:22:49.059000"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 23ms (Views: 15.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:22:49.099138"], ["updated_at", "2019-06-21 15:22:49.099138"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.110486"], ["updated_at", "2019-06-21 15:22:49.110486"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561216969"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:22:49.115638"], ["updated_at", "2019-06-21 15:22:49.115638"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.120840"], ["updated_at", "2019-06-21 15:22:49.120840"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044169"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:22:49.124005"], ["updated_at", "2019-06-21 15:22:49.124005"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 336], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-21 15:22:49.140567"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 336]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.144239"], ["updated_at", "2019-06-21 15:22:49.144239"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:22:49.149203"], ["updated_at", "2019-06-21 15:22:49.149203"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.153855"], ["updated_at", "2019-06-21 15:22:49.153855"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.155825"], ["updated_at", "2019-06-21 15:22:49.155825"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.157716"], ["updated_at", "2019-06-21 15:22:49.157716"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.159516"], ["updated_at", "2019-06-21 15:22:49.159516"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.167315"], ["updated_at", "2019-06-21 15:22:49.167315"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 342], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 342], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:22:49.170967"], ["id", 342]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 342], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.175688"], ["updated_at", "2019-06-21 15:22:49.175688"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.177933"], ["updated_at", "2019-06-21 15:22:49.177933"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.179918"], ["updated_at", "2019-06-21 15:22:49.179918"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.181950"], ["updated_at", "2019-06-21 15:22:49.181950"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.191303"], ["updated_at", "2019-06-21 15:22:49.191303"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.198968"], ["updated_at", "2019-06-21 15:22:49.198968"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:22:49.204809"], ["updated_at", "2019-06-21 15:22:49.204809"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) 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 (0.3ms) 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-06-21 15:22:49.214043"], ["updated_at", "2019-06-21 15:22:49.214043"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:22:49.220642"], ["updated_at", "2019-06-21 15:22:49.220642"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-21 15:22:49.230639"], ["updated_at", "2019-06-21 15:22:49.230639"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) 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 (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.241908"], ["updated_at", "2019-06-21 15:22:49.241908"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.244149"], ["updated_at", "2019-06-21 15:22:49.244149"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) 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", 351], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:22:49.248432"], ["id", 351]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:22:49.253102"], ["updated_at", "2019-06-21 15:22:49.253102"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.255302"], ["updated_at", "2019-06-21 15:22:49.255302"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 353], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:22:49.258127"], ["id", 353]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 353], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.262197"], ["updated_at", "2019-06-21 15:22:49.262197"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.266156"], ["updated_at", "2019-06-21 15:22:49.266156"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 355], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:22:49.269682"], ["id", 355]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 355], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.273906"], ["updated_at", "2019-06-21 15:22:49.273906"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.276155"], ["updated_at", "2019-06-21 15:22:49.276155"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.280859"], ["updated_at", "2019-06-21 15:22:49.280859"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.5ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.286518"], ["updated_at", "2019-06-21 15:22:49.286518"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.288896"], ["updated_at", "2019-06-21 15:22:49.288896"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.293129"], ["updated_at", "2019-06-21 15:22:49.293129"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.295586"], ["updated_at", "2019-06-21 15:22:49.295586"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.302704"], ["updated_at", "2019-06-21 15:22:49.302704"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:22:49.306229"], ["updated_at", "2019-06-21 15:22:49.306229"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:22:49.310775"], ["updated_at", "2019-06-21 15:22:49.310775"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.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-06-21 15:22:49.313528"], ["updated_at", "2019-06-21 15:22:49.313528"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:22:49.322152"], ["updated_at", "2019-06-21 15:22:49.322152"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.327014"], ["updated_at", "2019-06-21 15:22:49.327014"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:22:49.331963"], ["updated_at", "2019-06-21 15:22:49.331963"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:22:49.356380"], ["updated_at", "2019-06-21 15:22:49.356380"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.362198"], ["updated_at", "2019-06-21 15:22:49.362198"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:22:49.364342"], ["updated_at", "2019-06-21 15:22:49.364342"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.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.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) 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.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.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:22.371939"], ["updated_at", "2019-06-21 15:23:22.371939"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:22.397428"], ["updated_at", "2019-06-21 15:23:22.397428"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-21 15:23:22.418347"], ["updated_at", "2019-06-21 15:23:22.418347"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:22.431709"], ["updated_at", "2019-06-21 15:23:22.431709"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.4ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:22.455792"], ["updated_at", "2019-06-21 15:23:22.455792"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:22.467062"], ["updated_at", "2019-06-21 15:23:22.467062"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.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 (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:23:22.508174"], ["updated_at", "2019-06-21 15:23:22.508174"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:23:22.516400"], ["updated_at", "2019-06-21 15:23:22.516400"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:23:22.519945"], ["updated_at", "2019-06-21 15:23:22.519945"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:23:22.523844"], ["updated_at", "2019-06-21 15:23:22.523844"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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-06-21 15:23:22.553898"], ["updated_at", "2019-06-21 15:23:22.553898"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.564311"], ["updated_at", "2019-06-21 15:23:22.564311"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.566630"], ["updated_at", "2019-06-21 15:23:22.566630"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) 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.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 360], ["LIMIT", 1]] Account Update (0.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-06-21 15:23:22.572731"], ["id", 360]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 360], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.581383"], ["updated_at", "2019-06-21 15:23:22.581383"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.583597"], ["updated_at", "2019-06-21 15:23:22.583597"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 362], ["LIMIT", 1]] Account Update (0.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-06-21 15:23:22.587029"], ["id", 362]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 362], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.599897"], ["updated_at", "2019-06-21 15:23:22.599897"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-21 15:23:22.602334"], ["updated_at", "2019-06-21 15:23:22.602334"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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", 364], ["LIMIT", 1]] Account Update (0.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-06-21 15:23:22.607920"], ["id", 364]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.613929"], ["updated_at", "2019-06-21 15:23:22.613929"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.615996"], ["updated_at", "2019-06-21 15:23:22.615996"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 366], ["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-06-21 15:23:22.619715"], ["id", 366]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.625972"], ["updated_at", "2019-06-21 15:23:22.625972"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) 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.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:23:22.632587"], ["updated_at", "2019-06-21 15:23:22.632587"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.639253"], ["updated_at", "2019-06-21 15:23:22.639253"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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 (0.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-06-21 15:23:22.647560"], ["updated_at", "2019-06-21 15:23:22.647560"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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-06-21 15:23:22.652601"], ["updated_at", "2019-06-21 15:23:22.652601"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:23:22.657797"], ["updated_at", "2019-06-21 15:23:22.657797"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.661868"], ["updated_at", "2019-06-21 15:23:22.661868"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:23:22.665519"], ["updated_at", "2019-06-21 15:23:22.665519"], ["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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:23:22.672464"], ["updated_at", "2019-06-21 15:23:22.672464"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:23:22.674464"], ["updated_at", "2019-06-21 15:23:22.674464"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:23:22.677036"], ["updated_at", "2019-06-21 15:23:22.677036"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:23:22.682550"], ["updated_at", "2019-06-21 15:23:22.682550"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:23:22.735937"], ["updated_at", "2019-06-21 15:23:22.735937"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:23:22.738128"], ["synced_id", 0], ["id", 379]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Exists (5.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:23:22.760170"], ["updated_at", "2019-06-21 15:23:22.760170"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 380], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 380], ["LIMIT", 1]] Account Update (0.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-06-21 15:23:22.764664"], ["id", 380]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 380], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:23:22.774679"], ["updated_at", "2019-06-21 15:23:22.774679"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:23:22.779854"], ["updated_at", "2019-06-21 15:23:22.779854"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217002"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:23:22.785416"], ["updated_at", "2019-06-21 15:23:22.785416"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044202"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 383], ["LIMIT", 1]] Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:23:22.805305"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 383]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.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 5ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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-06-21 15:23:22.849292"], ["updated_at", "2019-06-21 15:23:22.849292"], ["synced_id", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.876229"], ["updated_at", "2019-06-21 15:23:22.876229"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.879333"], ["updated_at", "2019-06-21 15:23:22.879333"], ["synced_id", 123], ["host", "test.host"]]  (0.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]]  (1.2ms) ROLLBACK  (0.4ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (1.4ms) ROLLBACK  (3.4ms) BEGIN  (0.9ms) ROLLBACK  (1.0ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.919862"], ["updated_at", "2019-06-21 15:23:22.919862"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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 (2.4ms) 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-06-21 15:23:22.929587"], ["updated_at", "2019-06-21 15:23:22.929587"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (2.7ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:22.940313"], ["updated_at", "2019-06-21 15:23:22.940313"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:23:22.948205"], ["updated_at", "2019-06-21 15:23:22.948205"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) 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.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" 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.tesu"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-21 15:23:22.964078"], ["updated_at", "2019-06-21 15:23:22.964078"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) 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 (0.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 (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:22.977919"], ["updated_at", "2019-06-21 15:23:22.977919"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:22.985422"], ["updated_at", "2019-06-21 15:23:22.985422"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:22.990143"], ["updated_at", "2019-06-21 15:23:22.990143"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) 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.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:23.015079"], ["updated_at", "2019-06-21 15:23:23.015079"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (3.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:23.024950"], ["updated_at", "2019-06-21 15:23:23.024950"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:23.028344"], ["updated_at", "2019-06-21 15:23:23.028344"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:23.031396"], ["updated_at", "2019-06-21 15:23:23.031396"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:23:23.036281"], ["updated_at", "2019-06-21 15:23:23.036281"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:23:23.060455"], ["updated_at", "2019-06-21 15:23:23.060455"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217003"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:23.064277"], ["updated_at", "2019-06-21 15:23:23.064277"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:23:23.069299"], ["updated_at", "2019-06-21 15:23:23.069299"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044203"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:23.076118"], ["updated_at", "2019-06-21 15:23:23.076118"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (5.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 383], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) 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-06-21 15:23:23.099847"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 383]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.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 (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:23.117317"], ["updated_at", "2019-06-21 15:23:23.117317"], ["synced_id", 1], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:23.124803"], ["updated_at", "2019-06-21 15:23:23.124803"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:23.127824"], ["updated_at", "2019-06-21 15:23:23.127824"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:23.131712"], ["updated_at", "2019-06-21 15:23:23.131712"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:23:23.138394"], ["updated_at", "2019-06-21 15:23:23.138394"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 388], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 388], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:23:23.142330"], ["id", 388]]  (0.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", 388], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:23:23.148256"], ["updated_at", "2019-06-21 15:23:23.148256"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:23:23.152046"], ["updated_at", "2019-06-21 15:23:23.152046"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.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.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-06-21 15:23:23.160599"], ["updated_at", "2019-06-21 15:23:23.160599"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:23:23.166472"], ["updated_at", "2019-06-21 15:23:23.166472"], ["provider", "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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:23:23.171570"], ["updated_at", "2019-06-21 15:23:23.171570"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:23:23.178829"], ["updated_at", "2019-06-21 15:23:23.178829"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:23:23.181233"], ["updated_at", "2019-06-21 15:23:23.181233"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:23:23.187150"], ["updated_at", "2019-06-21 15:23:23.187150"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:23:23.190831"], ["updated_at", "2019-06-21 15:23:23.190831"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:23:23.194982"], ["updated_at", "2019-06-21 15:23:23.194982"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:23:23.197355"], ["updated_at", "2019-06-21 15:23:23.197355"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 398], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:23:23.200553"], ["id", 398]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:23:23.206317"], ["updated_at", "2019-06-21 15:23:23.206317"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:23:23.209513"], ["updated_at", "2019-06-21 15:23:23.209513"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 400], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:23:23.213001"], ["id", 400]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 400], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-21 15:23:23.217881"], ["updated_at", "2019-06-21 15:23:23.217881"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:23:23.221696"], ["updated_at", "2019-06-21 15:23:23.221696"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 402], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:23:23.225517"], ["id", 402]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 402], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:23:23.230597"], ["updated_at", "2019-06-21 15:23:23.230597"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:23:23.232794"], ["updated_at", "2019-06-21 15:23:23.232794"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:23:23.240065"], ["updated_at", "2019-06-21 15:23:23.240065"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:23.244365"], ["updated_at", "2019-06-21 15:23:23.244365"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:23:23.250278"], ["updated_at", "2019-06-21 15:23:23.250278"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 24ms (Views: 17.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:23:23.292421"], ["updated_at", "2019-06-21 15:23:23.292421"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 1.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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-06-21 15:23:23.300960"], ["updated_at", "2019-06-21 15:23:23.300960"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:23:23.309372"], ["updated_at", "2019-06-21 15:23:23.309372"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:23:23.320188"], ["updated_at", "2019-06-21 15:23:23.320188"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-06-21 15:25:26.227415"], ["updated_at", "2019-06-21 15:25:26.227415"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 36ms (ActiveRecord: 4.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-06-21 15:25:26.237896"], ["updated_at", "2019-06-21 15:25:26.237896"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-06-21 15:25:26.247692"], ["updated_at", "2019-06-21 15:25:26.247692"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "test.host"], ["provider", "123"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "123"], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:25:26.288041"], ["updated_at", "2019-06-21 15:25:26.288041"], ["provider", "123"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 2.2ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 21ms (Views: 13.7ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.341545"], ["updated_at", "2019-06-21 15:25:26.341545"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.354071"], ["updated_at", "2019-06-21 15:25:26.354071"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.358552"], ["updated_at", "2019-06-21 15:25:26.358552"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (1.8ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.367034"], ["updated_at", "2019-06-21 15:25:26.367034"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.375416"], ["updated_at", "2019-06-21 15:25:26.375416"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.382247"], ["updated_at", "2019-06-21 15:25:26.382247"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.386223"], ["updated_at", "2019-06-21 15:25:26.386223"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.392451"], ["updated_at", "2019-06-21 15:25:26.392451"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.394544"], ["updated_at", "2019-06-21 15:25:26.394544"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["provider", "bookingsync"], ["id", 416], ["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-06-21 15:25:26.399229"], ["id", 416]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.405857"], ["updated_at", "2019-06-21 15:25:26.405857"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.408744"], ["updated_at", "2019-06-21 15:25:26.408744"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["provider", "bookingsync"], ["id", 418], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:25:26.411888"], ["id", 418]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 418], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["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-06-21 15:25:26.416857"], ["updated_at", "2019-06-21 15:25:26.416857"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.421053"], ["updated_at", "2019-06-21 15:25:26.421053"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["provider", "bookingsync"], ["id", 420], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:25:26.424842"], ["id", 420]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 420], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.429666"], ["updated_at", "2019-06-21 15:25:26.429666"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.432000"], ["updated_at", "2019-06-21 15:25:26.432000"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.437290"], ["updated_at", "2019-06-21 15:25:26.437290"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.442999"], ["updated_at", "2019-06-21 15:25:26.442999"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.445565"], ["updated_at", "2019-06-21 15:25:26.445565"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["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-06-21 15:25:26.450271"], ["updated_at", "2019-06-21 15:25:26.450271"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.453684"], ["updated_at", "2019-06-21 15:25:26.453684"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.459126"], ["updated_at", "2019-06-21 15:25:26.459126"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.461394"], ["updated_at", "2019-06-21 15:25:26.461394"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.465238"], ["updated_at", "2019-06-21 15:25:26.465238"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:26.470380"], ["updated_at", "2019-06-21 15:25:26.470380"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.481272"], ["updated_at", "2019-06-21 15:25:26.481272"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217126"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:26.485601"], ["updated_at", "2019-06-21 15:25:26.485601"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.490604"], ["updated_at", "2019-06-21 15:25:26.490604"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044326"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:26.493790"], ["updated_at", "2019-06-21 15:25:26.493790"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 433], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) 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-06-21 15:25:26.521149"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 433]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:26.525914"], ["updated_at", "2019-06-21 15:25:26.525914"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 434], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 434], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:25:26.529030"], ["id", 434]]  (0.2ms) 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", 434], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.538597"], ["updated_at", "2019-06-21 15:25:26.538597"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:26.542566"], ["updated_at", "2019-06-21 15:25:26.542566"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:26.546038"], ["updated_at", "2019-06-21 15:25:26.546038"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.552954"], ["updated_at", "2019-06-21 15:25:26.552954"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:26.557008"], ["updated_at", "2019-06-21 15:25:26.557008"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["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-06-21 15:25:26.576370"], ["updated_at", "2019-06-21 15:25:26.576370"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:25:26.604282"], ["updated_at", "2019-06-21 15:25:26.604282"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.619653"], ["updated_at", "2019-06-21 15:25:26.619653"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.627452"], ["updated_at", "2019-06-21 15:25:26.627452"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.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.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:26.659512"], ["updated_at", "2019-06-21 15:25:26.659512"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:26.677147"], ["updated_at", "2019-06-21 15:25:26.677147"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:26.689518"], ["updated_at", "2019-06-21 15:25:26.689518"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-21 15:25:26.701555"], ["updated_at", "2019-06-21 15:25:26.701555"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:26.721706"], ["updated_at", "2019-06-21 15:25:26.721706"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:26.740132"], ["updated_at", "2019-06-21 15:25:26.740132"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.7ms) ROLLBACK  (1.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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 (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-21 15:25:26.758392"], ["updated_at", "2019-06-21 15:25:26.758392"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:25:26.774433"], ["updated_at", "2019-06-21 15:25:26.774433"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 392], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 392], ["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-06-21 15:25:26.779866"], ["id", 392]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 392], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:25:26.787215"], ["updated_at", "2019-06-21 15:25:26.787215"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:25:26.792271"], ["updated_at", "2019-06-21 15:25:26.792271"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["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-06-21 15:25:26.800016"], ["updated_at", "2019-06-21 15:25:26.800016"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.809108"], ["updated_at", "2019-06-21 15:25:26.809108"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.814395"], ["updated_at", "2019-06-21 15:25:26.814395"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.821743"], ["updated_at", "2019-06-21 15:25:26.821743"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.828208"], ["updated_at", "2019-06-21 15:25:26.828208"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.836462"], ["updated_at", "2019-06-21 15:25:26.836462"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.843826"], ["updated_at", "2019-06-21 15:25:26.843826"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:26.852269"], ["updated_at", "2019-06-21 15:25:26.852269"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:25:26.859801"], ["updated_at", "2019-06-21 15:25:26.859801"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:25:26.868485"], ["updated_at", "2019-06-21 15:25:26.868485"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:25:26.873977"], ["updated_at", "2019-06-21 15:25:26.873977"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217126"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:25:26.878047"], ["updated_at", "2019-06-21 15:25:26.878047"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044326"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 406], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:25:26.898600"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 406]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $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-06-21 15:25:26.902945"], ["updated_at", "2019-06-21 15:25:26.902945"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:25:26.908078"], ["updated_at", "2019-06-21 15:25:26.908078"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:25:26.928334"], ["updated_at", "2019-06-21 15:25:26.928334"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:25:26.929873"], ["synced_id", 0], ["id", 409]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" 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-06-21 15:25:51.953957"], ["updated_at", "2019-06-21 15:25:51.953957"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:51.970159"], ["updated_at", "2019-06-21 15:25:51.970159"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:51.991617"], ["updated_at", "2019-06-21 15:25:51.991617"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "BOOKINGSYNC"], ["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.003374"], ["updated_at", "2019-06-21 15:25:52.003374"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 442], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 442], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:25:52.007713"], ["id", 442]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 442], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.013267"], ["updated_at", "2019-06-21 15:25:52.013267"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.015330"], ["updated_at", "2019-06-21 15:25:52.015330"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.019887"], ["updated_at", "2019-06-21 15:25:52.019887"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.027030"], ["updated_at", "2019-06-21 15:25:52.027030"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.029511"], ["updated_at", "2019-06-21 15:25:52.029511"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.035908"], ["updated_at", "2019-06-21 15:25:52.035908"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.040493"], ["updated_at", "2019-06-21 15:25:52.040493"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.046659"], ["updated_at", "2019-06-21 15:25:52.046659"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.048831"], ["updated_at", "2019-06-21 15:25:52.048831"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.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-06-21 15:25:52.052976"], ["updated_at", "2019-06-21 15:25:52.052976"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.056747"], ["updated_at", "2019-06-21 15:25:52.056747"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["provider", "bookingsync"], ["id", 452], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:25:52.060450"], ["id", 452]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.064442"], ["updated_at", "2019-06-21 15:25:52.064442"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.066536"], ["updated_at", "2019-06-21 15:25:52.066536"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["provider", "bookingsync"], ["id", 454], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:25:52.071371"], ["id", 454]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 454], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.076622"], ["updated_at", "2019-06-21 15:25:52.076622"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.078890"], ["updated_at", "2019-06-21 15:25:52.078890"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["provider", "bookingsync"], ["id", 456], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:25:52.081961"], ["id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 456], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.088575"], ["updated_at", "2019-06-21 15:25:52.088575"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.091189"], ["updated_at", "2019-06-21 15:25:52.091189"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-21 15:25:52.108633"], ["updated_at", "2019-06-21 15:25:52.108633"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.130210"], ["updated_at", "2019-06-21 15:25:52.130210"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.133560"], ["updated_at", "2019-06-21 15:25:52.133560"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.137377"], ["updated_at", "2019-06-21 15:25:52.137377"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.141559"], ["updated_at", "2019-06-21 15:25:52.141559"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.147082"], ["updated_at", "2019-06-21 15:25:52.147082"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.150206"], ["updated_at", "2019-06-21 15:25:52.150206"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.156211"], ["updated_at", "2019-06-21 15:25:52.156211"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217152"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.159952"], ["updated_at", "2019-06-21 15:25:52.159952"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.164411"], ["updated_at", "2019-06-21 15:25:52.164411"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044352"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.167720"], ["updated_at", "2019-06-21 15:25:52.167720"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 464], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:25:52.189783"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 464]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.193635"], ["updated_at", "2019-06-21 15:25:52.193635"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.197004"], ["updated_at", "2019-06-21 15:25:52.197004"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.213214"], ["updated_at", "2019-06-21 15:25:52.213214"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.221348"], ["updated_at", "2019-06-21 15:25:52.221348"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) 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-06-21 15:25:52.237196"], ["updated_at", "2019-06-21 15:25:52.237196"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.246373"], ["updated_at", "2019-06-21 15:25:52.246373"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.254995"], ["updated_at", "2019-06-21 15:25:52.254995"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.266263"], ["updated_at", "2019-06-21 15:25:52.266263"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.279996"], ["updated_at", "2019-06-21 15:25:52.279996"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:25:52.289000"], ["updated_at", "2019-06-21 15:25:52.289000"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:25:52.328535"], ["updated_at", "2019-06-21 15:25:52.328535"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:25:52.336943"], ["updated_at", "2019-06-21 15:25:52.336943"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:25:52.341169"], ["updated_at", "2019-06-21 15:25:52.341169"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 412], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 412], ["LIMIT", 1]] Account Update (0.2ms) 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-06-21 15:25:52.344762"], ["id", 412]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 412], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:25:52.348869"], ["updated_at", "2019-06-21 15:25:52.348869"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:25:52.360206"], ["updated_at", "2019-06-21 15:25:52.360206"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:25:52.361735"], ["synced_id", 0], ["id", 414]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:25:52.372523"], ["updated_at", "2019-06-21 15:25:52.372523"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["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-06-21 15:25:52.381930"], ["updated_at", "2019-06-21 15:25:52.381930"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.397954"], ["updated_at", "2019-06-21 15:25:52.397954"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.405187"], ["updated_at", "2019-06-21 15:25:52.405187"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.411736"], ["updated_at", "2019-06-21 15:25:52.411736"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["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-06-21 15:25:52.418638"], ["updated_at", "2019-06-21 15:25:52.418638"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.427468"], ["updated_at", "2019-06-21 15:25:52.427468"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.433286"], ["updated_at", "2019-06-21 15:25:52.433286"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.440765"], ["updated_at", "2019-06-21 15:25:52.440765"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:25:52.447004"], ["updated_at", "2019-06-21 15:25:52.447004"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:25:52.465125"], ["updated_at", "2019-06-21 15:25:52.465125"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217152"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:25:52.468874"], ["updated_at", "2019-06-21 15:25:52.468874"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044352"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 426], ["LIMIT", 1]] Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:25:52.485002"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 426]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:25:52.489702"], ["updated_at", "2019-06-21 15:25:52.489702"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.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-06-21 15:25:52.508565"], ["updated_at", "2019-06-21 15:25:52.508565"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.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-06-21 15:25:52.516556"], ["updated_at", "2019-06-21 15:25:52.516556"], ["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 7ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.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-06-21 15:25:52.528235"], ["updated_at", "2019-06-21 15:25:52.528235"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:25:52.539429"], ["updated_at", "2019-06-21 15:25:52.539429"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 19ms (Views: 12.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.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)  (0.3ms) ROLLBACK  (0.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.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:25:52.605467"], ["updated_at", "2019-06-21 15:25:52.605467"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.613002"], ["updated_at", "2019-06-21 15:25:52.613002"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:25:52.615452"], ["updated_at", "2019-06-21 15:25:52.615452"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:03.351982"], ["updated_at", "2019-06-21 15:30:03.351982"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:03.356532"], ["updated_at", "2019-06-21 15:30:03.356532"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:03.370361"], ["updated_at", "2019-06-21 15:30:03.370361"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:30:03.376320"], ["updated_at", "2019-06-21 15:30:03.376320"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 435], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 435], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:03.390842"], ["id", 435]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 435], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.399742"], ["updated_at", "2019-06-21 15:30:03.399742"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.405109"], ["updated_at", "2019-06-21 15:30:03.405109"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["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-06-21 15:30:03.411810"], ["updated_at", "2019-06-21 15:30:03.411810"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.421141"], ["updated_at", "2019-06-21 15:30:03.421141"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.427476"], ["updated_at", "2019-06-21 15:30:03.427476"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 AND "accounts"."id" != $2 LIMIT $3 [["provider", "bookingsync"], ["id", 440], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:03.432518"], ["id", 440]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.505352"], ["updated_at", "2019-06-21 15:30:03.505352"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 AND "accounts"."id" != $2 LIMIT $3 [["provider", "bookingsync"], ["id", 441], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:03.508732"], ["id", 441]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.513686"], ["updated_at", "2019-06-21 15:30:03.513686"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 AND "accounts"."id" != $2 LIMIT $3 [["provider", "bookingsync"], ["id", 442], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:03.516944"], ["id", 442]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.522499"], ["updated_at", "2019-06-21 15:30:03.522499"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 AND "accounts"."id" != $2 LIMIT $3 [["provider", "bookingsync"], ["id", 443], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:03.525909"], ["id", 443]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:30:03.530535"], ["updated_at", "2019-06-21 15:30:03.530535"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:03.534426"], ["updated_at", "2019-06-21 15:30:03.534426"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:30:03.560440"], ["updated_at", "2019-06-21 15:30:03.560440"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044603"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 446], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:30:03.575025"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 446]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:30:03.580144"], ["updated_at", "2019-06-21 15:30:03.580144"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217403"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:03.583575"], ["updated_at", "2019-06-21 15:30:03.583575"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:30:03.591594"], ["updated_at", "2019-06-21 15:30:03.591594"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:30:03.593504"], ["synced_id", 0], ["id", 449]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.614922"], ["updated_at", "2019-06-21 15:30:03.614922"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.628154"], ["updated_at", "2019-06-21 15:30:03.628154"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.641803"], ["updated_at", "2019-06-21 15:30:03.641803"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.652215"], ["updated_at", "2019-06-21 15:30:03.652215"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.661537"], ["updated_at", "2019-06-21 15:30:03.661537"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.669901"], ["updated_at", "2019-06-21 15:30:03.669901"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.719190"], ["updated_at", "2019-06-21 15:30:03.719190"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.721715"], ["updated_at", "2019-06-21 15:30:03.721715"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "test.host"], ["provider", "123"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:03.727769"], ["updated_at", "2019-06-21 15:30:03.727769"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "123"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.738989"], ["updated_at", "2019-06-21 15:30:03.738989"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.746588"], ["updated_at", "2019-06-21 15:30:03.746588"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044603"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.750027"], ["updated_at", "2019-06-21 15:30:03.750027"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 473], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-21 15:30:03.768146"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 473]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.772287"], ["updated_at", "2019-06-21 15:30:03.772287"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217403"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.775901"], ["updated_at", "2019-06-21 15:30:03.775901"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.780177"], ["updated_at", "2019-06-21 15:30:03.780177"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.785423"], ["updated_at", "2019-06-21 15:30:03.785423"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.789601"], ["updated_at", "2019-06-21 15:30:03.789601"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.792584"], ["updated_at", "2019-06-21 15:30:03.792584"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.797853"], ["updated_at", "2019-06-21 15:30:03.797853"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.801203"], ["updated_at", "2019-06-21 15:30:03.801203"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.818727"], ["updated_at", "2019-06-21 15:30:03.818727"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.824793"], ["updated_at", "2019-06-21 15:30:03.824793"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.830910"], ["updated_at", "2019-06-21 15:30:03.830910"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.833077"], ["updated_at", "2019-06-21 15:30:03.833077"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "example3.test"], ["provider", "123"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "123"], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:30:03.836768"], ["updated_at", "2019-06-21 15:30:03.836768"], ["provider", "123"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "example3.test"], ["provider", "123"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "123"], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:30:03.842331"], ["updated_at", "2019-06-21 15:30:03.842331"], ["provider", "123"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.845212"], ["updated_at", "2019-06-21 15:30:03.845212"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "example3.test"], ["provider", "123"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "123"], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:30:03.850405"], ["updated_at", "2019-06-21 15:30:03.850405"], ["provider", "123"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.852408"], ["updated_at", "2019-06-21 15:30:03.852408"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "example3.test"], ["provider", "123"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "123"], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:30:03.857458"], ["updated_at", "2019-06-21 15:30:03.857458"], ["provider", "123"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.859801"], ["updated_at", "2019-06-21 15:30:03.859801"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.864329"], ["updated_at", "2019-06-21 15:30:03.864329"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.866403"], ["updated_at", "2019-06-21 15:30:03.866403"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "example.test"], ["provider", "123"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "123"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:30:03.869243"], ["updated_at", "2019-06-21 15:30:03.869243"], ["provider", "123"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.875727"], ["updated_at", "2019-06-21 15:30:03.875727"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["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-06-21 15:30:03.878515"], ["updated_at", "2019-06-21 15:30:03.878515"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "example.test"], ["provider", "123"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "123"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:30:03.882116"], ["updated_at", "2019-06-21 15:30:03.882116"], ["provider", "123"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 491], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.887335"], ["updated_at", "2019-06-21 15:30:03.887335"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.890509"], ["updated_at", "2019-06-21 15:30:03.890509"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "example.test"], ["provider", "123"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "123"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:30:03.894047"], ["updated_at", "2019-06-21 15:30:03.894047"], ["provider", "123"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 494], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.899888"], ["updated_at", "2019-06-21 15:30:03.899888"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "bookingsync"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.902345"], ["updated_at", "2019-06-21 15:30:03.902345"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.909909"], ["updated_at", "2019-06-21 15:30:03.909909"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:03.915275"], ["updated_at", "2019-06-21 15:30:03.915275"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.918471"], ["updated_at", "2019-06-21 15:30:03.918471"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:03.923281"], ["updated_at", "2019-06-21 15:30:03.923281"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 501], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 501], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:30:03.926986"], ["id", 501]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 501], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:03.962864"], ["updated_at", "2019-06-21 15:30:03.962864"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 17ms (Views: 10.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-06-21 15:30:04.001881"], ["updated_at", "2019-06-21 15:30:04.001881"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-06-21 15:30:04.008699"], ["updated_at", "2019-06-21 15:30:04.008699"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "test.host"], ["provider", "123"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."provider" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["provider", "123"], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-21 15:30:04.017911"], ["updated_at", "2019-06-21 15:30:04.017911"], ["provider", "123"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."provider" = $1 LIMIT $2 [["provider", "bookingsync"], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-06-21 15:30:04.028997"], ["updated_at", "2019-06-21 15:30:04.028997"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.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.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.389261"], ["updated_at", "2019-06-21 15:30:24.389261"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.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-06-21 15:30:24.404835"], ["updated_at", "2019-06-21 15:30:24.404835"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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-06-21 15:30:24.419584"], ["updated_at", "2019-06-21 15:30:24.419584"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.424137"], ["updated_at", "2019-06-21 15:30:24.424137"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:24.449779"], ["updated_at", "2019-06-21 15:30:24.449779"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.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-06-21 15:30:24.452944"], ["updated_at", "2019-06-21 15:30:24.452944"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:24.459017"], ["updated_at", "2019-06-21 15:30:24.459017"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.461163"], ["updated_at", "2019-06-21 15:30:24.461163"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-21 15:30:24.468773"], ["updated_at", "2019-06-21 15:30:24.468773"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.475966"], ["updated_at", "2019-06-21 15:30:24.475966"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.478271"], ["updated_at", "2019-06-21 15:30:24.478271"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.482806"], ["updated_at", "2019-06-21 15:30:24.482806"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.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-06-21 15:30:24.486839"], ["updated_at", "2019-06-21 15:30:24.486839"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.492711"], ["updated_at", "2019-06-21 15:30:24.492711"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.494907"], ["updated_at", "2019-06-21 15:30:24.494907"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.498485"], ["updated_at", "2019-06-21 15:30:24.498485"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:24.501843"], ["updated_at", "2019-06-21 15:30:24.501843"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) 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"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) 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", 516], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:30:24.507182"], ["id", 516]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.511934"], ["updated_at", "2019-06-21 15:30:24.511934"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.513931"], ["updated_at", "2019-06-21 15:30:24.513931"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 518], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:30:24.517787"], ["id", 518]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 518], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:24.523313"], ["updated_at", "2019-06-21 15:30:24.523313"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.525496"], ["updated_at", "2019-06-21 15:30:24.525496"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 520], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:30:24.528203"], ["id", 520]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 520], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.532266"], ["updated_at", "2019-06-21 15:30:24.532266"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) 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", 522], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 522], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:30:24.538820"], ["id", 522]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 522], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.543062"], ["updated_at", "2019-06-21 15:30:24.543062"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.545103"], ["updated_at", "2019-06-21 15:30:24.545103"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.547132"], ["updated_at", "2019-06-21 15:30:24.547132"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.549595"], ["updated_at", "2019-06-21 15:30:24.549595"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:24.558452"], ["updated_at", "2019-06-21 15:30:24.558452"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044624"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.561547"], ["updated_at", "2019-06-21 15:30:24.561547"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 527], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:30:24.578680"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 527]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.582859"], ["updated_at", "2019-06-21 15:30:24.582859"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217424"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.586419"], ["updated_at", "2019-06-21 15:30:24.586419"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.590477"], ["updated_at", "2019-06-21 15:30:24.590477"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.599572"], ["updated_at", "2019-06-21 15:30:24.599572"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.603355"], ["updated_at", "2019-06-21 15:30:24.603355"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.606392"], ["updated_at", "2019-06-21 15:30:24.606392"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.611570"], ["updated_at", "2019-06-21 15:30:24.611570"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.635775"], ["updated_at", "2019-06-21 15:30:24.635775"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.639354"], ["updated_at", "2019-06-21 15:30:24.639354"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.641987"], ["updated_at", "2019-06-21 15:30:24.641987"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.644122"], ["updated_at", "2019-06-21 15:30:24.644122"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:24.648973"], ["updated_at", "2019-06-21 15:30:24.648973"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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 (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.669012"], ["updated_at", "2019-06-21 15:30:24.669012"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.682018"], ["updated_at", "2019-06-21 15:30:24.682018"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.702931"], ["updated_at", "2019-06-21 15:30:24.702931"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) 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]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) 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-06-21 15:30:24.719084"], ["updated_at", "2019-06-21 15:30:24.719084"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.733397"], ["updated_at", "2019-06-21 15:30:24.733397"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.747570"], ["updated_at", "2019-06-21 15:30:24.747570"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:24.757761"], ["updated_at", "2019-06-21 15:30:24.757761"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.771372"], ["updated_at", "2019-06-21 15:30:24.771372"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.773906"], ["updated_at", "2019-06-21 15:30:24.773906"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:24.793608"], ["updated_at", "2019-06-21 15:30:24.793608"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:24.820812"], ["updated_at", "2019-06-21 15:30:24.820812"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:24.828691"], ["updated_at", "2019-06-21 15:30:24.828691"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:24.836368"], ["updated_at", "2019-06-21 15:30:24.836368"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:24.845941"], ["updated_at", "2019-06-21 15:30:24.845941"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 18ms (Views: 11.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.887873"], ["updated_at", "2019-06-21 15:30:24.887873"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.891075"], ["updated_at", "2019-06-21 15:30:24.891075"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 459], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:24.894020"], ["id", 459]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 459], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.898254"], ["updated_at", "2019-06-21 15:30:24.898254"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.900690"], ["updated_at", "2019-06-21 15:30:24.900690"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 461], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:24.903487"], ["id", 461]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 461], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.908723"], ["updated_at", "2019-06-21 15:30:24.908723"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.910864"], ["updated_at", "2019-06-21 15:30:24.910864"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 463], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:24.914393"], ["id", 463]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.919027"], ["updated_at", "2019-06-21 15:30:24.919027"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.921482"], ["updated_at", "2019-06-21 15:30:24.921482"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 465], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:24.925707"], ["id", 465]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.929625"], ["updated_at", "2019-06-21 15:30:24.929625"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:24.933857"], ["updated_at", "2019-06-21 15:30:24.933857"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.937465"], ["updated_at", "2019-06-21 15:30:24.937465"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:24.941182"], ["updated_at", "2019-06-21 15:30:24.941182"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.944671"], ["updated_at", "2019-06-21 15:30:24.944671"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:24.947190"], ["updated_at", "2019-06-21 15:30:24.947190"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:24.950961"], ["updated_at", "2019-06-21 15:30:24.950961"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:24.953810"], ["updated_at", "2019-06-21 15:30:24.953810"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:24.958266"], ["updated_at", "2019-06-21 15:30:24.958266"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:24.961651"], ["updated_at", "2019-06-21 15:30:24.961651"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:30:24.978136"], ["updated_at", "2019-06-21 15:30:24.978136"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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-06-21 15:30:24.981970"], ["updated_at", "2019-06-21 15:30:24.981970"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044624"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:30:24.996868"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 477]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:25.000408"], ["updated_at", "2019-06-21 15:30:25.000408"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217424"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:25.003980"], ["updated_at", "2019-06-21 15:30:25.003980"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:25.005727"], ["updated_at", "2019-06-21 15:30:25.005727"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:25.007422"], ["updated_at", "2019-06-21 15:30:25.007422"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:30:25.011263"], ["updated_at", "2019-06-21 15:30:25.011263"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 482], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 482], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:25.014258"], ["id", 482]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 482], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:30:25.023440"], ["updated_at", "2019-06-21 15:30:25.023440"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:30:25.024992"], ["synced_id", 0], ["id", 483]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:25.030336"], ["updated_at", "2019-06-21 15:30:25.030336"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:25.032207"], ["updated_at", "2019-06-21 15:30:25.032207"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:25.034786"], ["updated_at", "2019-06-21 15:30:25.034786"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:25.039446"], ["updated_at", "2019-06-21 15:30:25.039446"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) 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: 2.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.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", 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-06-21 15:30:44.738172"], ["updated_at", "2019-06-21 15:30:44.738172"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:44.741632"], ["updated_at", "2019-06-21 15:30:44.741632"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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-06-21 15:30:44.745107"], ["updated_at", "2019-06-21 15:30:44.745107"], ["synced_id", 1], ["host", "example2.test"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:44.749604"], ["updated_at", "2019-06-21 15:30:44.749604"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:44.758773"], ["updated_at", "2019-06-21 15:30:44.758773"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:44.772133"], ["updated_at", "2019-06-21 15:30:44.772133"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.782660"], ["updated_at", "2019-06-21 15:30:44.782660"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 544], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 544], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:30:44.790851"], ["id", 544]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 544], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:44.833496"], ["updated_at", "2019-06-21 15:30:44.833496"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.847899"], ["updated_at", "2019-06-21 15:30:44.847899"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:44.854336"], ["updated_at", "2019-06-21 15:30:44.854336"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:44.856750"], ["updated_at", "2019-06-21 15:30:44.856750"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:44.858726"], ["updated_at", "2019-06-21 15:30:44.858726"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:44.860687"], ["updated_at", "2019-06-21 15:30:44.860687"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.866372"], ["updated_at", "2019-06-21 15:30:44.866372"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.869339"], ["updated_at", "2019-06-21 15:30:44.869339"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:44.876628"], ["updated_at", "2019-06-21 15:30:44.876628"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:44.880165"], ["updated_at", "2019-06-21 15:30:44.880165"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 553], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:30:44.884626"], ["id", 553]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:44.890671"], ["updated_at", "2019-06-21 15:30:44.890671"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:30:44.898520"], ["updated_at", "2019-06-21 15:30:44.898520"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 555], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:30:44.902078"], ["id", 555]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 555], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:44.907866"], ["updated_at", "2019-06-21 15:30:44.907866"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.910112"], ["updated_at", "2019-06-21 15:30:44.910112"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 557], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:30:44.913385"], ["id", 557]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 557], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.919788"], ["updated_at", "2019-06-21 15:30:44.919788"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.924549"], ["updated_at", "2019-06-21 15:30:44.924549"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.931757"], ["updated_at", "2019-06-21 15:30:44.931757"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.4ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.939517"], ["updated_at", "2019-06-21 15:30:44.939517"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.941630"], ["updated_at", "2019-06-21 15:30:44.941630"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.946030"], ["updated_at", "2019-06-21 15:30:44.946030"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:44.948802"], ["updated_at", "2019-06-21 15:30:44.948802"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:44.955299"], ["updated_at", "2019-06-21 15:30:44.955299"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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-06-21 15:30:44.957539"], ["updated_at", "2019-06-21 15:30:44.957539"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:44.965983"], ["updated_at", "2019-06-21 15:30:44.965983"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:44.987018"], ["updated_at", "2019-06-21 15:30:44.987018"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:44.990069"], ["updated_at", "2019-06-21 15:30:44.990069"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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-06-21 15:30:45.015580"], ["updated_at", "2019-06-21 15:30:45.015580"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044645"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:45.021459"], ["updated_at", "2019-06-21 15:30:45.021459"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 569], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:30:45.038210"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 569]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:30:45.042136"], ["updated_at", "2019-06-21 15:30:45.042136"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217445"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:45.045839"], ["updated_at", "2019-06-21 15:30:45.045839"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.050294"], ["updated_at", "2019-06-21 15:30:45.050294"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:45.054137"], ["updated_at", "2019-06-21 15:30:45.054137"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:45.057138"], ["updated_at", "2019-06-21 15:30:45.057138"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:45.115642"], ["updated_at", "2019-06-21 15:30:45.115642"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.122432"], ["updated_at", "2019-06-21 15:30:45.122432"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.124384"], ["updated_at", "2019-06-21 15:30:45.124384"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:45.141672"], ["updated_at", "2019-06-21 15:30:45.141672"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) 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.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:45.151345"], ["updated_at", "2019-06-21 15:30:45.151345"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:30:45.159576"], ["updated_at", "2019-06-21 15:30:45.159576"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:45.170103"], ["updated_at", "2019-06-21 15:30:45.170103"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 17ms (Views: 10.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:45.201216"], ["updated_at", "2019-06-21 15:30:45.201216"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:45.214268"], ["updated_at", "2019-06-21 15:30:45.214268"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:45.224020"], ["updated_at", "2019-06-21 15:30:45.224020"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.4ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:45.237951"], ["updated_at", "2019-06-21 15:30:45.237951"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:45.250668"], ["updated_at", "2019-06-21 15:30:45.250668"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:45.261283"], ["updated_at", "2019-06-21 15:30:45.261283"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:45.287919"], ["updated_at", "2019-06-21 15:30:45.287919"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:45.291641"], ["updated_at", "2019-06-21 15:30:45.291641"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:45.309044"], ["updated_at", "2019-06-21 15:30:45.309044"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:45.311117"], ["updated_at", "2019-06-21 15:30:45.311117"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:45.312973"], ["updated_at", "2019-06-21 15:30:45.312973"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:30:45.321387"], ["updated_at", "2019-06-21 15:30:45.321387"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 497], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 497], ["LIMIT", 1]] Account Update (0.2ms) 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-06-21 15:30:45.325775"], ["id", 497]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 497], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:45.330601"], ["updated_at", "2019-06-21 15:30:45.330601"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:45.333563"], ["updated_at", "2019-06-21 15:30:45.333563"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:45.335461"], ["updated_at", "2019-06-21 15:30:45.335461"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:45.345287"], ["updated_at", "2019-06-21 15:30:45.345287"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044645"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 501], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:30:45.365638"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 501]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:45.369596"], ["updated_at", "2019-06-21 15:30:45.369596"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217445"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:30:45.376601"], ["updated_at", "2019-06-21 15:30:45.376601"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:30:45.378198"], ["synced_id", 0], ["id", 503]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.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-06-21 15:30:45.389554"], ["updated_at", "2019-06-21 15:30:45.389554"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:30:45.396686"], ["updated_at", "2019-06-21 15:30:45.396686"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.407181"], ["updated_at", "2019-06-21 15:30:45.407181"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:45.411524"], ["updated_at", "2019-06-21 15:30:45.411524"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.416427"], ["updated_at", "2019-06-21 15:30:45.416427"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:45.419388"], ["updated_at", "2019-06-21 15:30:45.419388"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.423013"], ["updated_at", "2019-06-21 15:30:45.423013"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:45.425893"], ["updated_at", "2019-06-21 15:30:45.425893"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.429768"], ["updated_at", "2019-06-21 15:30:45.429768"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:30:45.433458"], ["updated_at", "2019-06-21 15:30:45.433458"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.436946"], ["updated_at", "2019-06-21 15:30:45.436946"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.438861"], ["updated_at", "2019-06-21 15:30:45.438861"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 515], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:45.441683"], ["id", 515]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.445891"], ["updated_at", "2019-06-21 15:30:45.445891"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.448157"], ["updated_at", "2019-06-21 15:30:45.448157"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 517], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:45.451531"], ["id", 517]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.455024"], ["updated_at", "2019-06-21 15:30:45.455024"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.457375"], ["updated_at", "2019-06-21 15:30:45.457375"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 519], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:45.460675"], ["id", 519]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 519], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.465769"], ["updated_at", "2019-06-21 15:30:45.465769"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:30:45.467724"], ["updated_at", "2019-06-21 15:30:45.467724"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 521], ["LIMIT", 1]] Account Update (0.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-06-21 15:30:45.470247"], ["id", 521]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 521], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:30:45.475785"], ["updated_at", "2019-06-21 15:30:45.475785"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.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-06-21 15:35:42.790592"], ["updated_at", "2019-06-21 15:35:42.790592"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) 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.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:35:42.850172"], ["updated_at", "2019-06-21 15:35:42.850172"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:35:42.911579"], ["updated_at", "2019-06-21 15:35:42.911579"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:35:42.924765"], ["updated_at", "2019-06-21 15:35:42.924765"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044942"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 524], ["LIMIT", 1]] Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-21 15:35:42.954929"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 524]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.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-06-21 15:35:42.960281"], ["updated_at", "2019-06-21 15:35:42.960281"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217742"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-21 15:35:42.970389"], ["updated_at", "2019-06-21 15:35:42.970389"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-21 15:35:42.971945"], ["synced_id", 0], ["id", 526]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:35:42.985587"], ["updated_at", "2019-06-21 15:35:42.985587"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:42.989644"], ["updated_at", "2019-06-21 15:35:42.989644"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:35:42.994112"], ["updated_at", "2019-06-21 15:35:42.994112"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.000204"], ["updated_at", "2019-06-21 15:35:43.000204"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:35:43.003430"], ["updated_at", "2019-06-21 15:35:43.003430"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.008532"], ["updated_at", "2019-06-21 15:35:43.008532"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:35:43.011490"], ["updated_at", "2019-06-21 15:35:43.011490"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.017027"], ["updated_at", "2019-06-21 15:35:43.017027"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:35:43.020799"], ["updated_at", "2019-06-21 15:35:43.020799"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.026263"], ["updated_at", "2019-06-21 15:35:43.026263"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.028725"], ["updated_at", "2019-06-21 15:35:43.028725"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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 (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-06-21 15:35:43.033623"], ["id", 537]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.039069"], ["updated_at", "2019-06-21 15:35:43.039069"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.041085"], ["updated_at", "2019-06-21 15:35:43.041085"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 539], ["LIMIT", 1]] Account Update (0.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-06-21 15:35:43.044702"], ["id", 539]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.051316"], ["updated_at", "2019-06-21 15:35:43.051316"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-21 15:35:43.053894"], ["updated_at", "2019-06-21 15:35:43.053894"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 541], ["LIMIT", 1]] Account Update (0.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-06-21 15:35:43.058669"], ["id", 541]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 541], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.065583"], ["updated_at", "2019-06-21 15:35:43.065583"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.068639"], ["updated_at", "2019-06-21 15:35:43.068639"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (5.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 543], ["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-06-21 15:35:43.080969"], ["id", 543]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 543], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:35:43.089719"], ["updated_at", "2019-06-21 15:35:43.089719"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:35:43.098486"], ["updated_at", "2019-06-21 15:35:43.098486"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:35:43.102286"], ["updated_at", "2019-06-21 15:35:43.102286"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-21 15:35:43.108403"], ["updated_at", "2019-06-21 15:35:43.108403"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 547], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 547], ["LIMIT", 1]] Account Update (0.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-06-21 15:35:43.111949"], ["id", 547]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 547], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:35:43.120915"], ["updated_at", "2019-06-21 15:35:43.120915"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:35:43.125412"], ["updated_at", "2019-06-21 15:35:43.125412"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:35:43.127921"], ["updated_at", "2019-06-21 15:35:43.127921"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:35:43.129925"], ["updated_at", "2019-06-21 15:35:43.129925"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one 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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.177810"], ["updated_at", "2019-06-21 15:35:43.177810"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.183979"], ["updated_at", "2019-06-21 15:35:43.183979"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-21 15:35:43.194453"], ["updated_at", "2019-06-21 15:35:43.194453"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:35:43.222277"], ["updated_at", "2019-06-21 15:35:43.222277"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561044943"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:35:43.226765"], ["updated_at", "2019-06-21 15:35:43.226765"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 577], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-21 15:35:43.251493"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 577]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:35:43.256591"], ["updated_at", "2019-06-21 15:35:43.256591"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561217743"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:35:43.260939"], ["updated_at", "2019-06-21 15:35:43.260939"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.266147"], ["updated_at", "2019-06-21 15:35:43.266147"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.268887"], ["updated_at", "2019-06-21 15:35:43.268887"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.270899"], ["updated_at", "2019-06-21 15:35:43.270899"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.272921"], ["updated_at", "2019-06-21 15:35:43.272921"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:35:43.283850"], ["updated_at", "2019-06-21 15:35:43.283850"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 583], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 583], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:35:43.287898"], ["id", 583]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 583], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:35:43.292791"], ["updated_at", "2019-06-21 15:35:43.292791"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) 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.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.5ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:35:43.316386"], ["updated_at", "2019-06-21 15:35:43.316386"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:35:43.321910"], ["updated_at", "2019-06-21 15:35:43.321910"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.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-06-21 15:35:43.327095"], ["updated_at", "2019-06-21 15:35:43.327095"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (5.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 586], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:35:43.340802"], ["id", 586]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.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", "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-06-21 15:35:43.350934"], ["updated_at", "2019-06-21 15:35:43.350934"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:35:43.356146"], ["updated_at", "2019-06-21 15:35:43.356146"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) 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"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 588], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:35:43.364563"], ["id", 588]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 588], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:35:43.369916"], ["updated_at", "2019-06-21 15:35:43.369916"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:35:43.372305"], ["updated_at", "2019-06-21 15:35:43.372305"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 590], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-21 15:35:43.375749"], ["id", 590]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 590], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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-06-21 15:35:43.383179"], ["updated_at", "2019-06-21 15:35:43.383179"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:35:43.386621"], ["updated_at", "2019-06-21 15:35:43.386621"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:35:43.390750"], ["updated_at", "2019-06-21 15:35:43.390750"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:35:43.396617"], ["updated_at", "2019-06-21 15:35:43.396617"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:35:43.400909"], ["updated_at", "2019-06-21 15:35:43.400909"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.4ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:35:43.406268"], ["updated_at", "2019-06-21 15:35:43.406268"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:35:43.408666"], ["updated_at", "2019-06-21 15:35:43.408666"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:35:43.413654"], ["updated_at", "2019-06-21 15:35:43.413654"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-21 15:35:43.416760"], ["updated_at", "2019-06-21 15:35:43.416760"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:35:43.420982"], ["updated_at", "2019-06-21 15:35:43.420982"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-21 15:35:43.425413"], ["updated_at", "2019-06-21 15:35:43.425413"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:35:43.436354"], ["updated_at", "2019-06-21 15:35:43.436354"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.443359"], ["updated_at", "2019-06-21 15:35:43.443359"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:35:43.448710"], ["updated_at", "2019-06-21 15:35:43.448710"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.454235"], ["updated_at", "2019-06-21 15:35:43.454235"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:35:43.458283"], ["updated_at", "2019-06-21 15:35:43.458283"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.4ms) 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-06-21 15:35:43.462638"], ["updated_at", "2019-06-21 15:35:43.462638"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.3ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.469672"], ["updated_at", "2019-06-21 15:35:43.469672"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.472168"], ["updated_at", "2019-06-21 15:35:43.472168"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.474536"], ["updated_at", "2019-06-21 15:35:43.474536"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.477296"], ["updated_at", "2019-06-21 15:35:43.477296"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-21 15:35:43.483720"], ["updated_at", "2019-06-21 15:35:43.483720"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:35:43.487892"], ["updated_at", "2019-06-21 15:35:43.487892"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 4ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:35:43.538313"], ["updated_at", "2019-06-21 15:35:43.538313"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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.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-06-21 15:35:43.548166"], ["updated_at", "2019-06-21 15:35:43.548166"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-21 15:35:43.555689"], ["updated_at", "2019-06-21 15:35:43.555689"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-21 15:35:43.565950"], ["updated_at", "2019-06-21 15:35:43.565950"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 22ms (Views: 13.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:35:43.610035"], ["updated_at", "2019-06-21 15:35:43.610035"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:35:43.621872"], ["updated_at", "2019-06-21 15:35:43.621872"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:35:43.639008"], ["updated_at", "2019-06-21 15:35:43.639008"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) 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-06-21 15:35:43.652246"], ["updated_at", "2019-06-21 15:35:43.652246"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:35:43.660819"], ["updated_at", "2019-06-21 15:35:43.660819"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-21 15:35:43.676260"], ["updated_at", "2019-06-21 15:35:43.676260"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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.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-06-23 22:05:19.737913"], ["updated_at", "2019-06-23 22:05:19.737913"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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 (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:19.751865"], ["updated_at", "2019-06-23 22:05:19.751865"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:19.790715"], ["updated_at", "2019-06-23 22:05:19.790715"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:19.794674"], ["updated_at", "2019-06-23 22:05:19.794674"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:19.796829"], ["updated_at", "2019-06-23 22:05:19.796829"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:19.799070"], ["updated_at", "2019-06-23 22:05:19.799070"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.805792"], ["updated_at", "2019-06-23 22:05:19.805792"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 616], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 616], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:05:19.815129"], ["id", 616]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 616], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:05:19.821585"], ["updated_at", "2019-06-23 22:05:19.821585"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.823707"], ["updated_at", "2019-06-23 22:05:19.823707"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 617], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:05:19.827435"], ["id", 617]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.832023"], ["updated_at", "2019-06-23 22:05:19.832023"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.834116"], ["updated_at", "2019-06-23 22:05:19.834116"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) 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"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 619], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:05:19.839314"], ["id", 619]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 619], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.844702"], ["updated_at", "2019-06-23 22:05:19.844702"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.846643"], ["updated_at", "2019-06-23 22:05:19.846643"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 621], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:05:19.849590"], ["id", 621]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 621], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.855442"], ["updated_at", "2019-06-23 22:05:19.855442"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.858191"], ["updated_at", "2019-06-23 22:05:19.858191"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.862219"], ["updated_at", "2019-06-23 22:05:19.862219"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.866894"], ["updated_at", "2019-06-23 22:05:19.866894"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.870190"], ["updated_at", "2019-06-23 22:05:19.870190"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.874457"], ["updated_at", "2019-06-23 22:05:19.874457"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.877471"], ["updated_at", "2019-06-23 22:05:19.877471"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.881447"], ["updated_at", "2019-06-23 22:05:19.881447"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.883800"], ["updated_at", "2019-06-23 22:05:19.883800"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.888197"], ["updated_at", "2019-06-23 22:05:19.888197"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.890459"], ["updated_at", "2019-06-23 22:05:19.890459"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:05:19.896991"], ["updated_at", "2019-06-23 22:05:19.896991"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561241119"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:19.900274"], ["updated_at", "2019-06-23 22:05:19.900274"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 634], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) 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-06-23 22:05:19.918690"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 634]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:05:19.924371"], ["updated_at", "2019-06-23 22:05:19.924371"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561413919"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:19.928301"], ["updated_at", "2019-06-23 22:05:19.928301"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:19.932389"], ["updated_at", "2019-06-23 22:05:19.932389"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:19.937202"], ["updated_at", "2019-06-23 22:05:19.937202"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:19.940293"], ["updated_at", "2019-06-23 22:05:19.940293"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:19.945045"], ["updated_at", "2019-06-23 22:05:19.945045"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:19.947017"], ["updated_at", "2019-06-23 22:05:19.947017"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:19.948908"], ["updated_at", "2019-06-23 22:05:19.948908"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:19.951420"], ["updated_at", "2019-06-23 22:05:19.951420"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:05:19.956370"], ["updated_at", "2019-06-23 22:05:19.956370"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) 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.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:19.975050"], ["updated_at", "2019-06-23 22:05:19.975050"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:19.978263"], ["updated_at", "2019-06-23 22:05:19.978263"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:19.981351"], ["updated_at", "2019-06-23 22:05:19.981351"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:19.992402"], ["updated_at", "2019-06-23 22:05:19.992402"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) 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]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:05:20.074673"], ["updated_at", "2019-06-23 22:05:20.074673"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 5.4ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:05:20.080880"], ["updated_at", "2019-06-23 22:05:20.080880"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:05:20.087144"], ["updated_at", "2019-06-23 22:05:20.087144"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:05:20.095716"], ["updated_at", "2019-06-23 22:05:20.095716"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 21ms (Views: 14.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:05:20.155274"], ["updated_at", "2019-06-23 22:05:20.155274"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.163386"], ["updated_at", "2019-06-23 22:05:20.163386"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.165733"], ["updated_at", "2019-06-23 22:05:20.165733"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:20.176005"], ["updated_at", "2019-06-23 22:05:20.176005"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:20.189648"], ["updated_at", "2019-06-23 22:05:20.189648"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:20.202096"], ["updated_at", "2019-06-23 22:05:20.202096"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:20.210339"], ["updated_at", "2019-06-23 22:05:20.210339"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:20.222805"], ["updated_at", "2019-06-23 22:05:20.222805"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:20.230958"], ["updated_at", "2019-06-23 22:05:20.230958"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:05:20.239803"], ["updated_at", "2019-06-23 22:05:20.239803"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:05:20.244969"], ["updated_at", "2019-06-23 22:05:20.244969"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 560], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 560], ["LIMIT", 1]] Account Update (0.2ms) 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-06-23 22:05:20.248118"], ["id", 560]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 560], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.253066"], ["updated_at", "2019-06-23 22:05:20.253066"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.255167"], ["updated_at", "2019-06-23 22:05:20.255167"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 562], ["LIMIT", 1]] Account Update (0.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-06-23 22:05:20.258014"], ["id", 562]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.262039"], ["updated_at", "2019-06-23 22:05:20.262039"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.263894"], ["updated_at", "2019-06-23 22:05:20.263894"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 564], ["LIMIT", 1]] Account Update (0.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-06-23 22:05:20.266394"], ["id", 564]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.270712"], ["updated_at", "2019-06-23 22:05:20.270712"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.272627"], ["updated_at", "2019-06-23 22:05:20.272627"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 566], ["LIMIT", 1]] Account Update (0.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-06-23 22:05:20.275389"], ["id", 566]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 566], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.281044"], ["updated_at", "2019-06-23 22:05:20.281044"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.283453"], ["updated_at", "2019-06-23 22:05:20.283453"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 568], ["LIMIT", 1]] Account Update (0.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-06-23 22:05:20.287674"], ["id", 568]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 568], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-23 22:05:20.292835"], ["updated_at", "2019-06-23 22:05:20.292835"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:05:20.297096"], ["updated_at", "2019-06-23 22:05:20.297096"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.301753"], ["updated_at", "2019-06-23 22:05:20.301753"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:05:20.305465"], ["updated_at", "2019-06-23 22:05:20.305465"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.308868"], ["updated_at", "2019-06-23 22:05:20.308868"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:05:20.311888"], ["updated_at", "2019-06-23 22:05:20.311888"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:05:20.314846"], ["updated_at", "2019-06-23 22:05:20.314846"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:05:20.317364"], ["updated_at", "2019-06-23 22:05:20.317364"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:05:20.321779"], ["updated_at", "2019-06-23 22:05:20.321779"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:05:20.323719"], ["updated_at", "2019-06-23 22:05:20.323719"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:05:20.325707"], ["updated_at", "2019-06-23 22:05:20.325707"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:05:20.330275"], ["updated_at", "2019-06-23 22:05:20.330275"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:05:20.346693"], ["updated_at", "2019-06-23 22:05:20.346693"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:05:20.353422"], ["updated_at", "2019-06-23 22:05:20.353422"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:05:20.354895"], ["synced_id", 0], ["id", 582]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:05:20.368105"], ["updated_at", "2019-06-23 22:05:20.368105"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:05:20.371713"], ["updated_at", "2019-06-23 22:05:20.371713"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:05:20.375124"], ["updated_at", "2019-06-23 22:05:20.375124"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561241120"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.4ms) SAVEPOINT active_record_2 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", 585], ["LIMIT", 1]] Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:05:20.393287"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 585]]  (0.3ms) RELEASE SAVEPOINT active_record_2  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) 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-06-23 22:05:20.400464"], ["updated_at", "2019-06-23 22:05:20.400464"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561413920"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:05:20.405973"], ["updated_at", "2019-06-23 22:05:20.405973"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:05:20.408539"], ["updated_at", "2019-06-23 22:05:20.408539"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:05:20.411296"], ["updated_at", "2019-06-23 22:05:20.411296"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (3.3ms) SELECT pg_try_advisory_lock(6944829044693186745)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to AddCustomBookingSyncKeyIdToAccounts (20190623220013)  (0.2ms) BEGIN  (2.2ms) ALTER TABLE "accounts" ADD "customized_key" integer ActiveRecord::SchemaMigration Create (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20190623220013"]]  (0.5ms) COMMIT Migrating to AddCustomBookingSyncKeyIdToMultiApplicationsAccounts (20190623220132)  (0.2ms) BEGIN  (0.4ms) ALTER TABLE "multi_applications_accounts" ADD "customized_key" integer ActiveRecord::SchemaMigration Create (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20190623220132"]]  (0.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.2ms) BEGIN  (0.1ms) COMMIT  (0.2ms) SELECT pg_advisory_unlock(6944829044693186745)  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.2ms) BEGIN  (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-23 22:07:40.602223"], ["updated_at", "2019-06-23 22:07:40.602223"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) 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.2ms) BEGIN  (0.3ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:07:40.623668"], ["updated_at", "2019-06-23 22:07:40.623668"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) 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-06-23 22:07:40.642832"], ["updated_at", "2019-06-23 22:07:40.642832"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-23 22:07:40.659453"], ["updated_at", "2019-06-23 22:07:40.659453"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) 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-06-23 22:07:40.674936"], ["updated_at", "2019-06-23 22:07:40.674936"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:07:40.684294"], ["updated_at", "2019-06-23 22:07:40.684294"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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.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-06-23 22:07:40.719519"], ["updated_at", "2019-06-23 22:07:40.719519"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 590], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 590], ["LIMIT", 1]] Account Update (0.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-06-23 22:07:40.728562"], ["id", 590]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 590], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:07:40.733336"], ["updated_at", "2019-06-23 22:07:40.733336"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:40.739271"], ["updated_at", "2019-06-23 22:07:40.739271"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:40.742535"], ["updated_at", "2019-06-23 22:07:40.742535"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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 (0.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-06-23 22:07:40.745910"], ["id", 593]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 593], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-23 22:07:40.751047"], ["updated_at", "2019-06-23 22:07:40.751047"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:40.753854"], ["updated_at", "2019-06-23 22:07:40.753854"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 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-06-23 22:07:40.758497"], ["id", 595]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 595], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:40.768061"], ["updated_at", "2019-06-23 22:07:40.768061"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:40.770333"], ["updated_at", "2019-06-23 22:07:40.770333"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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", 597], ["LIMIT", 1]] Account Update (0.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-06-23 22:07:40.774989"], ["id", 597]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:40.780443"], ["updated_at", "2019-06-23 22:07:40.780443"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:40.783920"], ["updated_at", "2019-06-23 22:07:40.783920"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 599], ["LIMIT", 1]] Account Update (0.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-06-23 22:07:40.786924"], ["id", 599]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:40.791042"], ["updated_at", "2019-06-23 22:07:40.791042"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:07:40.795734"], ["updated_at", "2019-06-23 22:07:40.795734"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:40.799891"], ["updated_at", "2019-06-23 22:07:40.799891"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:07:40.802443"], ["updated_at", "2019-06-23 22:07:40.802443"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:40.806616"], ["updated_at", "2019-06-23 22:07:40.806616"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:07:40.811032"], ["updated_at", "2019-06-23 22:07:40.811032"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:40.814909"], ["updated_at", "2019-06-23 22:07:40.814909"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:07:40.817611"], ["updated_at", "2019-06-23 22:07:40.817611"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:07:40.821012"], ["updated_at", "2019-06-23 22:07:40.821012"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:07:40.848071"], ["updated_at", "2019-06-23 22:07:40.848071"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561241260"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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", 609], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:07:40.863673"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 609]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:07:40.867406"], ["updated_at", "2019-06-23 22:07:40.867406"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561414060"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:07:40.870716"], ["updated_at", "2019-06-23 22:07:40.870716"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:07:40.873219"], ["updated_at", "2019-06-23 22:07:40.873219"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:07:40.876054"], ["updated_at", "2019-06-23 22:07:40.876054"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:07:40.880598"], ["updated_at", "2019-06-23 22:07:40.880598"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:07:40.884256"], ["updated_at", "2019-06-23 22:07:40.884256"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:07:40.893874"], ["updated_at", "2019-06-23 22:07:40.893874"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:07:40.896050"], ["synced_id", 0], ["id", 616]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:07:40.918405"], ["updated_at", "2019-06-23 22:07:40.918405"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:07:40.920233"], ["updated_at", "2019-06-23 22:07:40.920233"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:07:40.922205"], ["updated_at", "2019-06-23 22:07:40.922205"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 3], ["LIMIT", 1]]  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_2 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.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-06-23 22:07:40.968554"], ["updated_at", "2019-06-23 22:07:40.968554"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.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-06-23 22:07:40.970863"], ["updated_at", "2019-06-23 22:07:40.970863"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_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-06-23 22:07:40.978737"], ["updated_at", "2019-06-23 22:07:40.978737"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_2  (0.3ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (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-06-23 22:07:40.983478"], ["updated_at", "2019-06-23 22:07:40.983478"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_2  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 22:07:40.993279"], ["updated_at", "2019-06-23 22:07:40.993279"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_2  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 22:07:41.001838"], ["updated_at", "2019-06-23 22:07:41.001838"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.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-06-23 22:07:41.004011"], ["updated_at", "2019-06-23 22:07:41.004011"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 22:07:41.011360"], ["updated_at", "2019-06-23 22:07:41.011360"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.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-06-23 22:07:41.015361"], ["updated_at", "2019-06-23 22:07:41.015361"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 22:07:41.020398"], ["updated_at", "2019-06-23 22:07:41.020398"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (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-06-23 22:07:41.023857"], ["updated_at", "2019-06-23 22:07:41.023857"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_2  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:07:41.029738"], ["updated_at", "2019-06-23 22:07:41.029738"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.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-06-23 22:07:41.033321"], ["updated_at", "2019-06-23 22:07:41.033321"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 22:07:41.037236"], ["updated_at", "2019-06-23 22:07:41.037236"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.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-06-23 22:07:41.045051"], ["updated_at", "2019-06-23 22:07:41.045051"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.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-06-23 22:07:41.047523"], ["updated_at", "2019-06-23 22:07:41.047523"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 22:07:41.050731"], ["updated_at", "2019-06-23 22:07:41.050731"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 661], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:07:41.055684"], ["updated_at", "2019-06-23 22:07:41.055684"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.2ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:07:41.059336"], ["updated_at", "2019-06-23 22:07:41.059336"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 22:07:41.062880"], ["updated_at", "2019-06-23 22:07:41.062880"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 664], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:07:41.069670"], ["updated_at", "2019-06-23 22:07:41.069670"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.076229"], ["updated_at", "2019-06-23 22:07:41.076229"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.078817"], ["updated_at", "2019-06-23 22:07:41.078817"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.2ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.081498"], ["updated_at", "2019-06-23 22:07:41.081498"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.083381"], ["updated_at", "2019-06-23 22:07:41.083381"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."customized_key" = $2 LIMIT $3 [["host", "example2.test"], ["customized_key", 1], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.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-06-23 22:07:41.088820"], ["updated_at", "2019-06-23 22:07:41.088820"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.099667"], ["updated_at", "2019-06-23 22:07:41.099667"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.102232"], ["updated_at", "2019-06-23 22:07:41.102232"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.104289"], ["updated_at", "2019-06-23 22:07:41.104289"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.106513"], ["updated_at", "2019-06-23 22:07:41.106513"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."customized_key" = $2 LIMIT $3 [["host", "example2.test"], ["customized_key", 1], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:07:41.112789"], ["updated_at", "2019-06-23 22:07:41.112789"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561241261"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:07:41.117370"], ["updated_at", "2019-06-23 22:07:41.117370"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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", 676], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-23 22:07:41.135421"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 676]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:07:41.139898"], ["updated_at", "2019-06-23 22:07:41.139898"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561414061"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-23 22:07:41.144918"], ["updated_at", "2019-06-23 22:07:41.144918"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_2 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.155431"], ["updated_at", "2019-06-23 22:07:41.155431"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-23 22:07:41.160827"], ["updated_at", "2019-06-23 22:07:41.160827"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.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-06-23 22:07:41.183465"], ["updated_at", "2019-06-23 22:07:41.183465"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 679], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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", 679], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:07:41.187741"], ["id", 679]]  (0.1ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 679], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.193561"], ["updated_at", "2019-06-23 22:07:41.193561"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:07:41.198232"], ["updated_at", "2019-06-23 22:07:41.198232"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.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-06-23 22:07:41.202862"], ["updated_at", "2019-06-23 22:07:41.202862"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.207343"], ["updated_at", "2019-06-23 22:07:41.207343"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_2  (0.2ms) SAVEPOINT active_record_2 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.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-06-23 22:07:41.212707"], ["updated_at", "2019-06-23 22:07:41.212707"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:07:41.216367"], ["updated_at", "2019-06-23 22:07:41.216367"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 19ms (Views: 12.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 22:07:41.277617"], ["updated_at", "2019-06-23 22:07:41.277617"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.1ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 22:07:41.284383"], ["updated_at", "2019-06-23 22:07:41.284383"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 22:07:41.294029"], ["updated_at", "2019-06-23 22:07:41.294029"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 22:07:41.303805"], ["updated_at", "2019-06-23 22:07:41.303805"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_2 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) 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.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:07:41.329557"], ["updated_at", "2019-06-23 22:07:41.329557"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:07:41.335446"], ["updated_at", "2019-06-23 22:07:41.335446"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.342725"], ["updated_at", "2019-06-23 22:07:41.342725"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:07:41.345014"], ["updated_at", "2019-06-23 22:07:41.345014"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."customized_key" = $2 LIMIT $3 [["host", "test.host"], ["customized_key", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) BEGIN  (0.2ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-23 22:17:16.136976"], ["updated_at", "2019-06-23 22:17:16.136976"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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: 0.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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-06-23 22:17:16.223247"], ["updated_at", "2019-06-23 22:17:16.223247"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 18ms (ActiveRecord: 4.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:17:16.233227"], ["updated_at", "2019-06-23 22:17:16.233227"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.258133"], ["updated_at", "2019-06-23 22:17:16.258133"], ["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.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 2.3ms)  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:17:16.269792"], ["updated_at", "2019-06-23 22:17:16.269792"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 17ms (Views: 10.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:17:16.304586"], ["updated_at", "2019-06-23 22:17:16.304586"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.328364"], ["updated_at", "2019-06-23 22:17:16.328364"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.330522"], ["updated_at", "2019-06-23 22:17:16.330522"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 629], ["LIMIT", 1]] Account Update (0.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-06-23 22:17:16.333963"], ["id", 629]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.338727"], ["updated_at", "2019-06-23 22:17:16.338727"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.340764"], ["updated_at", "2019-06-23 22:17:16.340764"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 631], ["LIMIT", 1]] Account Update (0.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-06-23 22:17:16.344054"], ["id", 631]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 631], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.348228"], ["updated_at", "2019-06-23 22:17:16.348228"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.350063"], ["updated_at", "2019-06-23 22:17:16.350063"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 633], ["LIMIT", 1]] Account Update (0.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-06-23 22:17:16.352580"], ["id", 633]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 633], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.356389"], ["updated_at", "2019-06-23 22:17:16.356389"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.358617"], ["updated_at", "2019-06-23 22:17:16.358617"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 635], ["LIMIT", 1]] Account Update (0.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-06-23 22:17:16.363027"], ["id", 635]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.367289"], ["updated_at", "2019-06-23 22:17:16.367289"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:17:16.370795"], ["updated_at", "2019-06-23 22:17:16.370795"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.375031"], ["updated_at", "2019-06-23 22:17:16.375031"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:17:16.379934"], ["updated_at", "2019-06-23 22:17:16.379934"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.384198"], ["updated_at", "2019-06-23 22:17:16.384198"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:17:16.386845"], ["updated_at", "2019-06-23 22:17:16.386845"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.389937"], ["updated_at", "2019-06-23 22:17:16.389937"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:17:16.392826"], ["updated_at", "2019-06-23 22:17:16.392826"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:17:16.400959"], ["updated_at", "2019-06-23 22:17:16.400959"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:17:16.402430"], ["synced_id", 0], ["id", 644]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:17:16.414575"], ["updated_at", "2019-06-23 22:17:16.414575"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "customized_key" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:17:16.416580"], ["customized_key", 0], ["id", 645]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:17:16.432032"], ["updated_at", "2019-06-23 22:17:16.432032"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:17:16.434882"], ["updated_at", "2019-06-23 22:17:16.434882"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:17:16.436217"], ["updated_at", "2019-06-23 22:17:16.436217"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:17:16.437409"], ["updated_at", "2019-06-23 22:17:16.437409"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:17:16.440954"], ["updated_at", "2019-06-23 22:17:16.440954"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:17:16.447473"], ["updated_at", "2019-06-23 22:17:16.447473"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 651], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) 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-06-23 22:17:16.450207"], ["id", 651]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 651], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:17:16.453598"], ["updated_at", "2019-06-23 22:17:16.453598"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:17:16.457102"], ["updated_at", "2019-06-23 22:17:16.457102"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561241836"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:17:16.475510"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 653]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:17:16.480499"], ["updated_at", "2019-06-23 22:17:16.480499"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561414636"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:17:16.505643"], ["updated_at", "2019-06-23 22:17:16.505643"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:17:16.507347"], ["updated_at", "2019-06-23 22:17:16.507347"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:17:16.509163"], ["updated_at", "2019-06-23 22:17:16.509163"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:17:16.516234"], ["updated_at", "2019-06-23 22:17:16.516234"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.525856"], ["updated_at", "2019-06-23 22:17:16.525856"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 688], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 688], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:17:16.530518"], ["id", 688]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 688], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.535840"], ["updated_at", "2019-06-23 22:17:16.535840"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.539511"], ["updated_at", "2019-06-23 22:17:16.539511"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.543734"], ["updated_at", "2019-06-23 22:17:16.543734"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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-06-23 22:17:16.549045"], ["updated_at", "2019-06-23 22:17:16.549045"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561241836"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.552376"], ["updated_at", "2019-06-23 22:17:16.552376"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 691], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-23 22:17:16.570892"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 691]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.575126"], ["updated_at", "2019-06-23 22:17:16.575126"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561414636"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.579600"], ["updated_at", "2019-06-23 22:17:16.579600"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:17:16.584447"], ["updated_at", "2019-06-23 22:17:16.584447"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.586561"], ["updated_at", "2019-06-23 22:17:16.586561"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 693], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:17:16.589366"], ["id", 693]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:17:16.593446"], ["updated_at", "2019-06-23 22:17:16.593446"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.596543"], ["updated_at", "2019-06-23 22:17:16.596543"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 695], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:17:16.599751"], ["id", 695]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 695], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.604504"], ["updated_at", "2019-06-23 22:17:16.604504"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.606555"], ["updated_at", "2019-06-23 22:17:16.606555"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 697], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:17:16.610543"], ["id", 697]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 697], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:17:16.615269"], ["updated_at", "2019-06-23 22:17:16.615269"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.617954"], ["updated_at", "2019-06-23 22:17:16.617954"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.621278"], ["updated_at", "2019-06-23 22:17:16.621278"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.627719"], ["updated_at", "2019-06-23 22:17:16.627719"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.631022"], ["updated_at", "2019-06-23 22:17:16.631022"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.636441"], ["updated_at", "2019-06-23 22:17:16.636441"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.638673"], ["updated_at", "2019-06-23 22:17:16.638673"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) 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.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-06-23 22:17:16.644374"], ["updated_at", "2019-06-23 22:17:16.644374"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.647226"], ["updated_at", "2019-06-23 22:17:16.647226"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:17:16.651221"], ["updated_at", "2019-06-23 22:17:16.651221"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:17:16.653423"], ["updated_at", "2019-06-23 22:17:16.653423"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.658175"], ["updated_at", "2019-06-23 22:17:16.658175"], ["synced_id", 123], ["host", "test.example"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.663625"], ["updated_at", "2019-06-23 22:17:16.663625"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.667150"], ["updated_at", "2019-06-23 22:17:16.667150"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.671036"], ["updated_at", "2019-06-23 22:17:16.671036"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.672990"], ["updated_at", "2019-06-23 22:17:16.672990"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.675201"], ["updated_at", "2019-06-23 22:17:16.675201"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.678636"], ["updated_at", "2019-06-23 22:17:16.678636"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.683607"], ["updated_at", "2019-06-23 22:17:16.683607"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.685665"], ["updated_at", "2019-06-23 22:17:16.685665"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.687567"], ["updated_at", "2019-06-23 22:17:16.687567"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.689598"], ["updated_at", "2019-06-23 22:17:16.689598"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.696434"], ["updated_at", "2019-06-23 22:17:16.696434"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.701656"], ["updated_at", "2019-06-23 22:17:16.701656"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.704788"], ["updated_at", "2019-06-23 22:17:16.704788"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.723437"], ["updated_at", "2019-06-23 22:17:16.723437"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.736665"], ["updated_at", "2019-06-23 22:17:16.736665"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) 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 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.765841"], ["updated_at", "2019-06-23 22:17:16.765841"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.779072"], ["updated_at", "2019-06-23 22:17:16.779072"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.791215"], ["updated_at", "2019-06-23 22:17:16.791215"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:17:16.805348"], ["updated_at", "2019-06-23 22:17:16.805348"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.819102"], ["updated_at", "2019-06-23 22:17:16.819102"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:17:16.821233"], ["updated_at", "2019-06-23 22:17:16.821233"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:17:16.825898"], ["updated_at", "2019-06-23 22:17:16.825898"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one 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-06-23 22:20:23.596156"], ["updated_at", "2019-06-23 22:20:23.596156"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.599233"], ["updated_at", "2019-06-23 22:20:23.599233"], ["synced_id", 123], ["host", "test.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:20:23.616914"], ["updated_at", "2019-06-23 22:20:23.616914"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.623369"], ["updated_at", "2019-06-23 22:20:23.623369"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.627142"], ["updated_at", "2019-06-23 22:20:23.627142"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.654042"], ["updated_at", "2019-06-23 22:20:23.654042"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.657519"], ["updated_at", "2019-06-23 22:20:23.657519"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:20:23.662339"], ["updated_at", "2019-06-23 22:20:23.662339"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.675261"], ["updated_at", "2019-06-23 22:20:23.675261"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.677346"], ["updated_at", "2019-06-23 22:20:23.677346"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.679318"], ["updated_at", "2019-06-23 22:20:23.679318"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.681309"], ["updated_at", "2019-06-23 22:20:23.681309"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.688510"], ["updated_at", "2019-06-23 22:20:23.688510"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.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 (0.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-06-23 22:20:23.709278"], ["updated_at", "2019-06-23 22:20:23.709278"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561414823"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.712778"], ["updated_at", "2019-06-23 22:20:23.712778"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.718099"], ["updated_at", "2019-06-23 22:20:23.718099"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242023"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.722664"], ["updated_at", "2019-06-23 22:20:23.722664"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.4ms) 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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 732], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-23 22:20:23.741915"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 732]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.746245"], ["updated_at", "2019-06-23 22:20:23.746245"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.748495"], ["updated_at", "2019-06-23 22:20:23.748495"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.752184"], ["updated_at", "2019-06-23 22:20:23.752184"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.754558"], ["updated_at", "2019-06-23 22:20:23.754558"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.758628"], ["updated_at", "2019-06-23 22:20:23.758628"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 737], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 737], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:20:23.765676"], ["id", 737]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 737], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.769992"], ["updated_at", "2019-06-23 22:20:23.769992"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.772309"], ["updated_at", "2019-06-23 22:20:23.772309"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.779635"], ["updated_at", "2019-06-23 22:20:23.779635"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.782658"], ["updated_at", "2019-06-23 22:20:23.782658"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.787558"], ["updated_at", "2019-06-23 22:20:23.787558"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.793073"], ["updated_at", "2019-06-23 22:20:23.793073"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.795265"], ["updated_at", "2019-06-23 22:20:23.795265"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.800589"], ["updated_at", "2019-06-23 22:20:23.800589"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.803817"], ["updated_at", "2019-06-23 22:20:23.803817"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.809154"], ["updated_at", "2019-06-23 22:20:23.809154"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.811701"], ["updated_at", "2019-06-23 22:20:23.811701"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.816653"], ["updated_at", "2019-06-23 22:20:23.816653"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.819278"], ["updated_at", "2019-06-23 22:20:23.819278"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 749], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:20:23.822688"], ["id", 749]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:20:23.826650"], ["updated_at", "2019-06-23 22:20:23.826650"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.828798"], ["updated_at", "2019-06-23 22:20:23.828798"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 751], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:20:23.832236"], ["id", 751]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 751], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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-06-23 22:20:23.837883"], ["updated_at", "2019-06-23 22:20:23.837883"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.840004"], ["updated_at", "2019-06-23 22:20:23.840004"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 753], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:20:23.843305"], ["id", 753]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 753], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:23.848716"], ["updated_at", "2019-06-23 22:20:23.848716"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.853478"], ["updated_at", "2019-06-23 22:20:23.853478"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.857326"], ["updated_at", "2019-06-23 22:20:23.857326"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:23.861800"], ["updated_at", "2019-06-23 22:20:23.861800"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.868674"], ["updated_at", "2019-06-23 22:20:23.868674"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.874330"], ["updated_at", "2019-06-23 22:20:23.874330"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.888512"], ["updated_at", "2019-06-23 22:20:23.888512"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.896211"], ["updated_at", "2019-06-23 22:20:23.896211"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.905766"], ["updated_at", "2019-06-23 22:20:23.905766"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.918376"], ["updated_at", "2019-06-23 22:20:23.918376"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:20:23.926231"], ["updated_at", "2019-06-23 22:20:23.926231"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:20:23.941903"], ["updated_at", "2019-06-23 22:20:23.941903"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:20:23.943486"], ["synced_id", 0], ["id", 660]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:20:23.952254"], ["updated_at", "2019-06-23 22:20:23.952254"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "customized_key" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:20:23.953708"], ["customized_key", 0], ["id", 661]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:20:23.972217"], ["updated_at", "2019-06-23 22:20:23.972217"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:20:23.973700"], ["updated_at", "2019-06-23 22:20:23.973700"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:20:23.975010"], ["updated_at", "2019-06-23 22:20:23.975010"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:20:23.979772"], ["updated_at", "2019-06-23 22:20:23.979772"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:20:23.984667"], ["updated_at", "2019-06-23 22:20:23.984667"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 666], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Update (0.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-06-23 22:20:23.988108"], ["id", 666]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 666], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:20:23.991869"], ["updated_at", "2019-06-23 22:20:23.991869"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:20:23.994788"], ["updated_at", "2019-06-23 22:20:23.994788"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:20:23.997566"], ["updated_at", "2019-06-23 22:20:23.997566"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242023"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:20:24.012267"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 669]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:20:24.016073"], ["updated_at", "2019-06-23 22:20:24.016073"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561414824"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:20:24.019404"], ["updated_at", "2019-06-23 22:20:24.019404"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:20:24.020655"], ["updated_at", "2019-06-23 22:20:24.020655"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:20:24.022627"], ["updated_at", "2019-06-23 22:20:24.022627"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:24.026006"], ["updated_at", "2019-06-23 22:20:24.026006"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:24.027446"], ["updated_at", "2019-06-23 22:20:24.027446"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Update (0.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-06-23 22:20:24.029769"], ["id", 675]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:24.034761"], ["updated_at", "2019-06-23 22:20:24.034761"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:24.037161"], ["updated_at", "2019-06-23 22:20:24.037161"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Update (0.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-06-23 22:20:24.039363"], ["id", 677]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 677], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:24.042603"], ["updated_at", "2019-06-23 22:20:24.042603"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:24.044043"], ["updated_at", "2019-06-23 22:20:24.044043"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Update (0.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-06-23 22:20:24.046124"], ["id", 679]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 679], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:24.049377"], ["updated_at", "2019-06-23 22:20:24.049377"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:24.050750"], ["updated_at", "2019-06-23 22:20:24.050750"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Update (0.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-06-23 22:20:24.057772"], ["id", 681]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:24.060503"], ["updated_at", "2019-06-23 22:20:24.060503"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:20:24.063120"], ["updated_at", "2019-06-23 22:20:24.063120"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:20:24.067205"], ["updated_at", "2019-06-23 22:20:24.067205"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:20:24.070820"], ["updated_at", "2019-06-23 22:20:24.070820"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) SAVEPOINT active_record_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-06-23 22:20:24.077464"], ["updated_at", "2019-06-23 22:20:24.077464"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_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-06-23 22:20:24.080915"], ["updated_at", "2019-06-23 22:20:24.080915"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_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-06-23 22:20:24.085411"], ["updated_at", "2019-06-23 22:20:24.085411"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:20:24.088344"], ["updated_at", "2019-06-23 22:20:24.088344"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:20:24.091563"], ["updated_at", "2019-06-23 22:20:24.091563"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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: 2.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:20:24.141354"], ["updated_at", "2019-06-23 22:20:24.141354"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:20:24.146573"], ["updated_at", "2019-06-23 22:20:24.146573"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:20:24.155430"], ["updated_at", "2019-06-23 22:20:24.155430"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.6ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:20:24.163514"], ["updated_at", "2019-06-23 22:20:24.163514"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 16ms (Views: 10.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 6ms (Views: 4.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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: 0.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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 1ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-23 22:25:03.744353"], ["updated_at", "2019-06-23 22:25:03.744353"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:03.758686"], ["updated_at", "2019-06-23 22:25:03.758686"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:03.775715"], ["updated_at", "2019-06-23 22:25:03.775715"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.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 (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:03.791600"], ["updated_at", "2019-06-23 22:25:03.791600"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:03.800287"], ["updated_at", "2019-06-23 22:25:03.800287"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.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 (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:03.817806"], ["updated_at", "2019-06-23 22:25:03.817806"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.4ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-23 22:25:03.866707"], ["updated_at", "2019-06-23 22:25:03.866707"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) 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 (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 Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:03.879662"], ["updated_at", "2019-06-23 22:25:03.879662"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:03.881693"], ["updated_at", "2019-06-23 22:25:03.881693"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:03.883705"], ["updated_at", "2019-06-23 22:25:03.883705"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:03.885614"], ["updated_at", "2019-06-23 22:25:03.885614"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:03.891948"], ["updated_at", "2019-06-23 22:25:03.891948"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:25:03.917787"], ["updated_at", "2019-06-23 22:25:03.917787"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415103"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:03.922665"], ["updated_at", "2019-06-23 22:25:03.922665"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:25:03.929018"], ["updated_at", "2019-06-23 22:25:03.929018"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242303"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:03.932408"], ["updated_at", "2019-06-23 22:25:03.932408"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 764], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) 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-06-23 22:25:03.955159"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 764]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:03.960362"], ["updated_at", "2019-06-23 22:25:03.960362"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:03.962436"], ["updated_at", "2019-06-23 22:25:03.962436"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 765], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:25:03.965435"], ["id", 765]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:25:03.969820"], ["updated_at", "2019-06-23 22:25:03.969820"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:03.972064"], ["updated_at", "2019-06-23 22:25:03.972064"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 767], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:25:03.975056"], ["id", 767]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 767], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:03.980111"], ["updated_at", "2019-06-23 22:25:03.980111"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:03.982027"], ["updated_at", "2019-06-23 22:25:03.982027"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 769], ["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-06-23 22:25:03.985157"], ["id", 769]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 769], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:03.990583"], ["updated_at", "2019-06-23 22:25:03.990583"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:03.993043"], ["updated_at", "2019-06-23 22:25:03.993043"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:03.999004"], ["updated_at", "2019-06-23 22:25:03.999004"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:04.004810"], ["updated_at", "2019-06-23 22:25:04.004810"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:04.006914"], ["updated_at", "2019-06-23 22:25:04.006914"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:04.012535"], ["updated_at", "2019-06-23 22:25:04.012535"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:04.014641"], ["updated_at", "2019-06-23 22:25:04.014641"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:25:04.019574"], ["updated_at", "2019-06-23 22:25:04.019574"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:04.022099"], ["updated_at", "2019-06-23 22:25:04.022099"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:25:04.025889"], ["updated_at", "2019-06-23 22:25:04.025889"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:04.027950"], ["updated_at", "2019-06-23 22:25:04.027950"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.033467"], ["updated_at", "2019-06-23 22:25:04.033467"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:04.037692"], ["updated_at", "2019-06-23 22:25:04.037692"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.042198"], ["updated_at", "2019-06-23 22:25:04.042198"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:04.046123"], ["updated_at", "2019-06-23 22:25:04.046123"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.062805"], ["updated_at", "2019-06-23 22:25:04.062805"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:04.065897"], ["updated_at", "2019-06-23 22:25:04.065897"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:04.068694"], ["updated_at", "2019-06-23 22:25:04.068694"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:04.072546"], ["updated_at", "2019-06-23 22:25:04.072546"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:04.078303"], ["updated_at", "2019-06-23 22:25:04.078303"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 786], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 786], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:25:04.081465"], ["id", 786]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 786], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.086698"], ["updated_at", "2019-06-23 22:25:04.086698"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.088852"], ["updated_at", "2019-06-23 22:25:04.088852"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.090766"], ["updated_at", "2019-06-23 22:25:04.090766"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.092885"], ["updated_at", "2019-06-23 22:25:04.092885"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:25:04.117426"], ["updated_at", "2019-06-23 22:25:04.117426"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.124844"], ["updated_at", "2019-06-23 22:25:04.124844"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.127606"], ["updated_at", "2019-06-23 22:25:04.127606"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:25:04.138048"], ["updated_at", "2019-06-23 22:25:04.138048"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:25:04.146025"], ["updated_at", "2019-06-23 22:25:04.146025"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:25:04.153885"], ["updated_at", "2019-06-23 22:25:04.153885"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:25:04.163364"], ["updated_at", "2019-06-23 22:25:04.163364"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 17ms (Views: 10.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:25:04.199584"], ["updated_at", "2019-06-23 22:25:04.199584"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:25:04.204551"], ["updated_at", "2019-06-23 22:25:04.204551"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242304"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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 (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:25:04.222661"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 698]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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-06-23 22:25:04.226404"], ["updated_at", "2019-06-23 22:25:04.226404"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415104"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.230453"], ["updated_at", "2019-06-23 22:25:04.230453"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:25:04.233539"], ["updated_at", "2019-06-23 22:25:04.233539"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.238377"], ["updated_at", "2019-06-23 22:25:04.238377"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:25:04.240947"], ["updated_at", "2019-06-23 22:25:04.240947"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.244545"], ["updated_at", "2019-06-23 22:25:04.244545"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:25:04.247760"], ["updated_at", "2019-06-23 22:25:04.247760"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.250751"], ["updated_at", "2019-06-23 22:25:04.250751"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:25:04.254265"], ["updated_at", "2019-06-23 22:25:04.254265"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.257716"], ["updated_at", "2019-06-23 22:25:04.257716"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.259929"], ["updated_at", "2019-06-23 22:25:04.259929"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 709], ["LIMIT", 1]] Account Update (0.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-06-23 22:25:04.263293"], ["id", 709]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 709], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.267359"], ["updated_at", "2019-06-23 22:25:04.267359"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.270105"], ["updated_at", "2019-06-23 22:25:04.270105"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 711], ["LIMIT", 1]] Account Update (0.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-06-23 22:25:04.272803"], ["id", 711]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 711], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.277710"], ["updated_at", "2019-06-23 22:25:04.277710"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.280351"], ["updated_at", "2019-06-23 22:25:04.280351"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 713], ["LIMIT", 1]] Account Update (0.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-06-23 22:25:04.283154"], ["id", 713]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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-06-23 22:25:04.287758"], ["updated_at", "2019-06-23 22:25:04.287758"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:25:04.291025"], ["updated_at", "2019-06-23 22:25:04.291025"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 715], ["LIMIT", 1]] Account Update (0.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-06-23 22:25:04.294022"], ["id", 715]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:25:04.297921"], ["updated_at", "2019-06-23 22:25:04.297921"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:25:04.299723"], ["updated_at", "2019-06-23 22:25:04.299723"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:25:04.301446"], ["updated_at", "2019-06-23 22:25:04.301446"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:25:04.309032"], ["updated_at", "2019-06-23 22:25:04.309032"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:25:04.312558"], ["updated_at", "2019-06-23 22:25:04.312558"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:25:04.316296"], ["updated_at", "2019-06-23 22:25:04.316296"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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 (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:25:04.343058"], ["updated_at", "2019-06-23 22:25:04.343058"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:25:04.346745"], ["updated_at", "2019-06-23 22:25:04.346745"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 723], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 723], ["LIMIT", 1]] Account Update (0.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-06-23 22:25:04.349588"], ["id", 723]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 723], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:25:04.360203"], ["updated_at", "2019-06-23 22:25:04.360203"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:25:04.361871"], ["synced_id", 0], ["id", 724]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:25:04.377105"], ["updated_at", "2019-06-23 22:25:04.377105"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:25:04.379181"], ["updated_at", "2019-06-23 22:25:04.379181"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:25:04.381225"], ["updated_at", "2019-06-23 22:25:04.381225"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-23 22:26:45.988657"], ["updated_at", "2019-06-23 22:26:45.988657"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:26:46.027515"], ["updated_at", "2019-06-23 22:26:46.027515"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) 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 (5.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:26:46.059170"], ["updated_at", "2019-06-23 22:26:46.059170"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) 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-06-23 22:26:46.073871"], ["updated_at", "2019-06-23 22:26:46.073871"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (5.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:26:46.095835"], ["updated_at", "2019-06-23 22:26:46.095835"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:26:46.118630"], ["updated_at", "2019-06-23 22:26:46.118630"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.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-06-23 22:26:46.134004"], ["updated_at", "2019-06-23 22:26:46.134004"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) 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" 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-06-23 22:26:46.172327"], ["updated_at", "2019-06-23 22:26:46.172327"], ["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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 794], ["LIMIT", 1]]  (0.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"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 794], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) 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-06-23 22:26:46.192495"], ["id", 794]]  (0.2ms) 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", 794], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "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-06-23 22:26:46.207963"], ["updated_at", "2019-06-23 22:26:46.207963"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 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-06-23 22:26:46.235105"], ["updated_at", "2019-06-23 22:26:46.235105"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.244335"], ["updated_at", "2019-06-23 22:26:46.244335"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.247774"], ["updated_at", "2019-06-23 22:26:46.247774"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.251061"], ["updated_at", "2019-06-23 22:26:46.251061"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:26:46.257139"], ["updated_at", "2019-06-23 22:26:46.257139"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415206"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:26:46.260898"], ["updated_at", "2019-06-23 22:26:46.260898"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.266640"], ["updated_at", "2019-06-23 22:26:46.266640"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242406"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:26:46.269998"], ["updated_at", "2019-06-23 22:26:46.269998"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 801], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-23 22:26:46.292651"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 801]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.296962"], ["updated_at", "2019-06-23 22:26:46.296962"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.299819"], ["updated_at", "2019-06-23 22:26:46.299819"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.301890"], ["updated_at", "2019-06-23 22:26:46.301890"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.303858"], ["updated_at", "2019-06-23 22:26:46.303858"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.308830"], ["updated_at", "2019-06-23 22:26:46.308830"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:26:46.312107"], ["updated_at", "2019-06-23 22:26:46.312107"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:26:46.318042"], ["updated_at", "2019-06-23 22:26:46.318042"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.340429"], ["updated_at", "2019-06-23 22:26:46.340429"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.344432"], ["updated_at", "2019-06-23 22:26:46.344432"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) 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.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:26:46.349724"], ["updated_at", "2019-06-23 22:26:46.349724"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.5ms) 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-06-23 22:26:46.357712"], ["updated_at", "2019-06-23 22:26:46.357712"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.364170"], ["updated_at", "2019-06-23 22:26:46.364170"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:26:46.367639"], ["updated_at", "2019-06-23 22:26:46.367639"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:26:46.385491"], ["updated_at", "2019-06-23 22:26:46.385491"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.387580"], ["updated_at", "2019-06-23 22:26:46.387580"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 810], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:26:46.390778"], ["id", 810]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:26:46.396454"], ["updated_at", "2019-06-23 22:26:46.396454"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.398713"], ["updated_at", "2019-06-23 22:26:46.398713"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 812], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:26:46.401862"], ["id", 812]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 812], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:26:46.406425"], ["updated_at", "2019-06-23 22:26:46.406425"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.408646"], ["updated_at", "2019-06-23 22:26:46.408646"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 814], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:26:46.411944"], ["id", 814]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 814], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.416799"], ["updated_at", "2019-06-23 22:26:46.416799"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.419083"], ["updated_at", "2019-06-23 22:26:46.419083"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.422693"], ["updated_at", "2019-06-23 22:26:46.422693"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.427315"], ["updated_at", "2019-06-23 22:26:46.427315"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.429446"], ["updated_at", "2019-06-23 22:26:46.429446"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.433520"], ["updated_at", "2019-06-23 22:26:46.433520"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.435626"], ["updated_at", "2019-06-23 22:26:46.435626"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.439543"], ["updated_at", "2019-06-23 22:26:46.439543"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.441617"], ["updated_at", "2019-06-23 22:26:46.441617"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.444907"], ["updated_at", "2019-06-23 22:26:46.444907"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.447436"], ["updated_at", "2019-06-23 22:26:46.447436"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:26:46.468457"], ["updated_at", "2019-06-23 22:26:46.468457"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.474129"], ["updated_at", "2019-06-23 22:26:46.474129"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.476214"], ["updated_at", "2019-06-23 22:26:46.476214"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:26:46.483871"], ["updated_at", "2019-06-23 22:26:46.483871"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:26:46.490791"], ["updated_at", "2019-06-23 22:26:46.490791"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:26:46.497542"], ["updated_at", "2019-06-23 22:26:46.497542"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:26:46.505749"], ["updated_at", "2019-06-23 22:26:46.505749"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 17ms (Views: 11.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:26:46.538629"], ["updated_at", "2019-06-23 22:26:46.538629"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:26:46.544437"], ["updated_at", "2019-06-23 22:26:46.544437"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 733], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 733], ["LIMIT", 1]] Account Update (0.2ms) 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-06-23 22:26:46.547928"], ["id", 733]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 733], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:26:46.551758"], ["updated_at", "2019-06-23 22:26:46.551758"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:26:46.553514"], ["updated_at", "2019-06-23 22:26:46.553514"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:26:46.555163"], ["updated_at", "2019-06-23 22:26:46.555163"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:26:46.559243"], ["updated_at", "2019-06-23 22:26:46.559243"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:26:46.562246"], ["updated_at", "2019-06-23 22:26:46.562246"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:26:46.565673"], ["updated_at", "2019-06-23 22:26:46.565673"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:26:46.580741"], ["updated_at", "2019-06-23 22:26:46.580741"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415206"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:26:46.584566"], ["updated_at", "2019-06-23 22:26:46.584566"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242406"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 741], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:26:46.601567"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 741]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.605990"], ["updated_at", "2019-06-23 22:26:46.605990"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.607962"], ["updated_at", "2019-06-23 22:26:46.607962"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 743], ["LIMIT", 1]] Account Update (0.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-06-23 22:26:46.610576"], ["id", 743]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 743], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.614839"], ["updated_at", "2019-06-23 22:26:46.614839"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.616751"], ["updated_at", "2019-06-23 22:26:46.616751"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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-06-23 22:26:46.619616"], ["id", 745]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 745], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.625520"], ["updated_at", "2019-06-23 22:26:46.625520"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.628653"], ["updated_at", "2019-06-23 22:26:46.628653"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 747], ["LIMIT", 1]] Account Update (0.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-06-23 22:26:46.631822"], ["id", 747]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.635143"], ["updated_at", "2019-06-23 22:26:46.635143"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.637538"], ["updated_at", "2019-06-23 22:26:46.637538"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 749], ["LIMIT", 1]] Account Update (0.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-06-23 22:26:46.640616"], ["id", 749]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.643958"], ["updated_at", "2019-06-23 22:26:46.643958"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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.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-06-23 22:26:46.649061"], ["updated_at", "2019-06-23 22:26:46.649061"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.656118"], ["updated_at", "2019-06-23 22:26:46.656118"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:26:46.659809"], ["updated_at", "2019-06-23 22:26:46.659809"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.664881"], ["updated_at", "2019-06-23 22:26:46.664881"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:26:46.673870"], ["updated_at", "2019-06-23 22:26:46.673870"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:26:46.679024"], ["updated_at", "2019-06-23 22:26:46.679024"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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.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-06-23 22:26:46.683321"], ["updated_at", "2019-06-23 22:26:46.683321"], ["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.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:26:46.705105"], ["updated_at", "2019-06-23 22:26:46.705105"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:26:46.706703"], ["synced_id", 0], ["id", 758]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:26:46.714437"], ["updated_at", "2019-06-23 22:26:46.714437"], ["synced_id", 1]]  (0.4ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 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.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:26:46.719159"], ["updated_at", "2019-06-23 22:26:46.719159"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_2  (0.2ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:26:46.722605"], ["updated_at", "2019-06-23 22:26:46.722605"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Account Load (8.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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)  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) BEGIN  (0.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.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-06-23 22:27:15.396681"], ["updated_at", "2019-06-23 22:27:15.396681"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.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", "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-06-23 22:27:15.411142"], ["updated_at", "2019-06-23 22:27:15.411142"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.427305"], ["updated_at", "2019-06-23 22:27:15.427305"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.441565"], ["updated_at", "2019-06-23 22:27:15.441565"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.467304"], ["updated_at", "2019-06-23 22:27:15.467304"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.470724"], ["updated_at", "2019-06-23 22:27:15.470724"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.475952"], ["updated_at", "2019-06-23 22:27:15.475952"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.479897"], ["updated_at", "2019-06-23 22:27:15.479897"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.482208"], ["updated_at", "2019-06-23 22:27:15.482208"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.484364"], ["updated_at", "2019-06-23 22:27:15.484364"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.489737"], ["updated_at", "2019-06-23 22:27:15.489737"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415235"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.493591"], ["updated_at", "2019-06-23 22:27:15.493591"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_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-06-23 22:27:15.500074"], ["updated_at", "2019-06-23 22:27:15.500074"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242435"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.505169"], ["updated_at", "2019-06-23 22:27:15.505169"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 839], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) 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-06-23 22:27:15.526389"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 839]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.534077"], ["updated_at", "2019-06-23 22:27:15.534077"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.559288"], ["updated_at", "2019-06-23 22:27:15.559288"], ["synced_id", 123], ["host", "test.example"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (2.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.569951"], ["updated_at", "2019-06-23 22:27:15.569951"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.573730"], ["updated_at", "2019-06-23 22:27:15.573730"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.578174"], ["updated_at", "2019-06-23 22:27:15.578174"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.581103"], ["updated_at", "2019-06-23 22:27:15.581103"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.587696"], ["updated_at", "2019-06-23 22:27:15.587696"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.594124"], ["updated_at", "2019-06-23 22:27:15.594124"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.596960"], ["updated_at", "2019-06-23 22:27:15.596960"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.602090"], ["updated_at", "2019-06-23 22:27:15.602090"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.604706"], ["updated_at", "2019-06-23 22:27:15.604706"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.609397"], ["updated_at", "2019-06-23 22:27:15.609397"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:27:15.612233"], ["updated_at", "2019-06-23 22:27:15.612233"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:27:15.619376"], ["updated_at", "2019-06-23 22:27:15.619376"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:27:15.622009"], ["updated_at", "2019-06-23 22:27:15.622009"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 850], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:27:15.625677"], ["id", 850]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:27:15.629701"], ["updated_at", "2019-06-23 22:27:15.629701"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.633278"], ["updated_at", "2019-06-23 22:27:15.633278"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 852], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:27:15.636744"], ["id", 852]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 852], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:27:15.642296"], ["updated_at", "2019-06-23 22:27:15.642296"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.645050"], ["updated_at", "2019-06-23 22:27:15.645050"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 854], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:27:15.649653"], ["id", 854]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 854], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:27:15.654863"], ["updated_at", "2019-06-23 22:27:15.654863"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.656909"], ["updated_at", "2019-06-23 22:27:15.656909"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.661607"], ["updated_at", "2019-06-23 22:27:15.661607"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.664407"], ["updated_at", "2019-06-23 22:27:15.664407"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.667131"], ["updated_at", "2019-06-23 22:27:15.667131"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.669614"], ["updated_at", "2019-06-23 22:27:15.669614"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:15.673581"], ["updated_at", "2019-06-23 22:27:15.673581"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 862], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 862], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:27:15.676637"], ["id", 862]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 862], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.693822"], ["updated_at", "2019-06-23 22:27:15.693822"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.704043"], ["updated_at", "2019-06-23 22:27:15.704043"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.717034"], ["updated_at", "2019-06-23 22:27:15.717034"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.730866"], ["updated_at", "2019-06-23 22:27:15.730866"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.741065"], ["updated_at", "2019-06-23 22:27:15.741065"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:15.751906"], ["updated_at", "2019-06-23 22:27:15.751906"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:27:15.777939"], ["updated_at", "2019-06-23 22:27:15.777939"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:27:15.781406"], ["updated_at", "2019-06-23 22:27:15.781406"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:27:15.784898"], ["updated_at", "2019-06-23 22:27:15.784898"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:27:15.791908"], ["updated_at", "2019-06-23 22:27:15.791908"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242435"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 765], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:27:15.808908"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 765]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:27:15.813934"], ["updated_at", "2019-06-23 22:27:15.813934"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415235"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.822693"], ["updated_at", "2019-06-23 22:27:15.822693"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.824690"], ["updated_at", "2019-06-23 22:27:15.824690"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 768], ["LIMIT", 1]] Account Update (0.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-06-23 22:27:15.828012"], ["id", 768]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.832974"], ["updated_at", "2019-06-23 22:27:15.832974"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.836939"], ["updated_at", "2019-06-23 22:27:15.836939"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 770], ["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-06-23 22:27:15.841311"], ["id", 770]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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-06-23 22:27:15.850386"], ["updated_at", "2019-06-23 22:27:15.850386"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.853687"], ["updated_at", "2019-06-23 22:27:15.853687"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 772], ["LIMIT", 1]] Account Update (0.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-06-23 22:27:15.856753"], ["id", 772]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 772], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.861671"], ["updated_at", "2019-06-23 22:27:15.861671"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.865375"], ["updated_at", "2019-06-23 22:27:15.865375"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 774], ["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-06-23 22:27:15.870481"], ["id", 774]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 774], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.875954"], ["updated_at", "2019-06-23 22:27:15.875954"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:27:15.879762"], ["updated_at", "2019-06-23 22:27:15.879762"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.885989"], ["updated_at", "2019-06-23 22:27:15.885989"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:27:15.889140"], ["updated_at", "2019-06-23 22:27:15.889140"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.892576"], ["updated_at", "2019-06-23 22:27:15.892576"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:27:15.895278"], ["updated_at", "2019-06-23 22:27:15.895278"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:15.900155"], ["updated_at", "2019-06-23 22:27:15.900155"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:27:15.902896"], ["updated_at", "2019-06-23 22:27:15.902896"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:27:15.906766"], ["updated_at", "2019-06-23 22:27:15.906766"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:27:15.912359"], ["updated_at", "2019-06-23 22:27:15.912359"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:27:15.915306"], ["updated_at", "2019-06-23 22:27:15.915306"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:27:15.917712"], ["updated_at", "2019-06-23 22:27:15.917712"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:27:15.921953"], ["updated_at", "2019-06-23 22:27:15.921953"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:27:15.925396"], ["updated_at", "2019-06-23 22:27:15.925396"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:27:15.934212"], ["updated_at", "2019-06-23 22:27:15.934212"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:27:15.936460"], ["synced_id", 0], ["id", 789]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:27:15.972811"], ["updated_at", "2019-06-23 22:27:15.972811"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:27:15.989156"], ["updated_at", "2019-06-23 22:27:15.989156"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 791], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 791], ["LIMIT", 1]] Account Update (0.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-06-23 22:27:15.993388"], ["id", 791]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 791], ["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one 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-06-23 22:27:16.023798"], ["updated_at", "2019-06-23 22:27:16.023798"], ["synced_id", 123], ["host", "example.host"]]  (0.3ms) RELEASE SAVEPOINT active_record_2  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:27:16.028588"], ["updated_at", "2019-06-23 22:27:16.028588"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:27:16.036270"], ["updated_at", "2019-06-23 22:27:16.036270"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_2 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:27:16.041960"], ["updated_at", "2019-06-23 22:27:16.041960"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 18ms (Views: 12.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:27:16.083749"], ["updated_at", "2019-06-23 22:27:16.083749"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_2 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:27:16.090409"], ["updated_at", "2019-06-23 22:27:16.090409"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:27:16.097921"], ["updated_at", "2019-06-23 22:27:16.097921"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_2 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_2 MultiApplicationsAccount Exists (0.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.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-06-23 22:27:16.107091"], ["updated_at", "2019-06-23 22:27:16.107091"], ["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.1ms) RELEASE SAVEPOINT active_record_2 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) BEGIN  (0.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.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-06-23 22:29:04.629016"], ["updated_at", "2019-06-23 22:29:04.629016"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:04.631949"], ["updated_at", "2019-06-23 22:29:04.631949"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.3ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) 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") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:04.654927"], ["updated_at", "2019-06-23 22:29:04.654927"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) 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.4ms) 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.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:04.690054"], ["updated_at", "2019-06-23 22:29:04.690054"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.4ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:29:04.734545"], ["updated_at", "2019-06-23 22:29:04.734545"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:29:04.742009"], ["updated_at", "2019-06-23 22:29:04.742009"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:04.757323"], ["updated_at", "2019-06-23 22:29:04.757323"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:29:04.771788"], ["updated_at", "2019-06-23 22:29:04.771788"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.2ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.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-06-23 22:29:04.807023"], ["updated_at", "2019-06-23 22:29:04.807023"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:04.828933"], ["updated_at", "2019-06-23 22:29:04.828933"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:04.841505"], ["updated_at", "2019-06-23 22:29:04.841505"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:04.857629"], ["updated_at", "2019-06-23 22:29:04.857629"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:04.887193"], ["updated_at", "2019-06-23 22:29:04.887193"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:04.896076"], ["updated_at", "2019-06-23 22:29:04.896076"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:29:04.906959"], ["updated_at", "2019-06-23 22:29:04.906959"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415344"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:29:04.911109"], ["updated_at", "2019-06-23 22:29:04.911109"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242544"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) 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", 801], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:29:04.939979"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 801]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:29:04.959682"], ["updated_at", "2019-06-23 22:29:04.959682"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:04.965682"], ["updated_at", "2019-06-23 22:29:04.965682"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:04.968178"], ["updated_at", "2019-06-23 22:29:04.968178"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:04.970121"], ["updated_at", "2019-06-23 22:29:04.970121"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:04.974754"], ["updated_at", "2019-06-23 22:29:04.974754"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:29:04.978528"], ["updated_at", "2019-06-23 22:29:04.978528"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:04.982198"], ["updated_at", "2019-06-23 22:29:04.982198"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:29:04.984983"], ["updated_at", "2019-06-23 22:29:04.984983"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:04.990076"], ["updated_at", "2019-06-23 22:29:04.990076"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:29:04.993300"], ["updated_at", "2019-06-23 22:29:04.993300"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:04.996365"], ["updated_at", "2019-06-23 22:29:04.996365"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:29:04.999038"], ["updated_at", "2019-06-23 22:29:04.999038"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:05.002239"], ["updated_at", "2019-06-23 22:29:05.002239"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:05.004643"], ["updated_at", "2019-06-23 22:29:05.004643"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 815], ["LIMIT", 1]] Account Update (0.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-06-23 22:29:05.007910"], ["id", 815]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 815], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:05.012215"], ["updated_at", "2019-06-23 22:29:05.012215"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:05.013933"], ["updated_at", "2019-06-23 22:29:05.013933"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 817], ["LIMIT", 1]] Account Update (0.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-06-23 22:29:05.016161"], ["id", 817]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 817], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:05.020068"], ["updated_at", "2019-06-23 22:29:05.020068"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:05.022808"], ["updated_at", "2019-06-23 22:29:05.022808"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 819], ["LIMIT", 1]] Account Update (0.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-06-23 22:29:05.025238"], ["id", 819]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:05.028740"], ["updated_at", "2019-06-23 22:29:05.028740"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:05.030444"], ["updated_at", "2019-06-23 22:29:05.030444"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 821], ["LIMIT", 1]] Account Update (0.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-06-23 22:29:05.032667"], ["id", 821]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:29:05.035734"], ["updated_at", "2019-06-23 22:29:05.035734"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 822], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 822], ["LIMIT", 1]] Account Update (0.2ms) 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-06-23 22:29:05.039640"], ["id", 822]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 822], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:05.043970"], ["updated_at", "2019-06-23 22:29:05.043970"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:05.047095"], ["updated_at", "2019-06-23 22:29:05.047095"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:29:05.067099"], ["updated_at", "2019-06-23 22:29:05.067099"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:29:05.068537"], ["synced_id", 0], ["id", 825]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:29:23.369936"], ["updated_at", "2019-06-23 22:29:23.369936"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "customized_key" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:29:23.371704"], ["customized_key", 0], ["id", 826]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:23.392955"], ["updated_at", "2019-06-23 22:29:23.392955"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:23.394726"], ["updated_at", "2019-06-23 22:29:23.394726"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:23.396233"], ["updated_at", "2019-06-23 22:29:23.396233"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:23.400199"], ["updated_at", "2019-06-23 22:29:23.400199"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.403957"], ["updated_at", "2019-06-23 22:29:23.403957"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 869], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 869], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:29:23.407408"], ["id", 869]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 869], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:23.417184"], ["updated_at", "2019-06-23 22:29:23.417184"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:23.420553"], ["updated_at", "2019-06-23 22:29:23.420553"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:23.424847"], ["updated_at", "2019-06-23 22:29:23.424847"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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-06-23 22:29:23.435847"], ["updated_at", "2019-06-23 22:29:23.435847"], ["synced_id", 123], ["host", "test.example"]]  (0.4ms) 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.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.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:23.449118"], ["updated_at", "2019-06-23 22:29:23.449118"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:23.473998"], ["updated_at", "2019-06-23 22:29:23.473998"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415363"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:23.477522"], ["updated_at", "2019-06-23 22:29:23.477522"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:23.482102"], ["updated_at", "2019-06-23 22:29:23.482102"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242563"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.3ms) 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.7ms) 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 (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-06-23 22:29:23.493686"], ["updated_at", "2019-06-23 22:29:23.493686"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 874], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-23 22:29:23.513645"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 874]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:23.517525"], ["updated_at", "2019-06-23 22:29:23.517525"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.519596"], ["updated_at", "2019-06-23 22:29:23.519596"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:23.525863"], ["updated_at", "2019-06-23 22:29:23.525863"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.527905"], ["updated_at", "2019-06-23 22:29:23.527905"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.531320"], ["updated_at", "2019-06-23 22:29:23.531320"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.4ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.539803"], ["updated_at", "2019-06-23 22:29:23.539803"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.541974"], ["updated_at", "2019-06-23 22:29:23.541974"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.546462"], ["updated_at", "2019-06-23 22:29:23.546462"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-23 22:29:23.549025"], ["updated_at", "2019-06-23 22:29:23.549025"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.554889"], ["updated_at", "2019-06-23 22:29:23.554889"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.557113"], ["updated_at", "2019-06-23 22:29:23.557113"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:23.560600"], ["updated_at", "2019-06-23 22:29:23.560600"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.562460"], ["updated_at", "2019-06-23 22:29:23.562460"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 886], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:29:23.565058"], ["id", 886]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-23 22:29:23.569684"], ["updated_at", "2019-06-23 22:29:23.569684"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.572241"], ["updated_at", "2019-06-23 22:29:23.572241"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 888], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:29:23.574768"], ["id", 888]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 888], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.578414"], ["updated_at", "2019-06-23 22:29:23.578414"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.580230"], ["updated_at", "2019-06-23 22:29:23.580230"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 890], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:29:23.583434"], ["id", 890]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 890], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:23.588509"], ["updated_at", "2019-06-23 22:29:23.588509"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:23.592124"], ["updated_at", "2019-06-23 22:29:23.592124"], ["synced_id", 1], ["host", "example.test"]]  (0.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", 2], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:23.596763"], ["updated_at", "2019-06-23 22:29:23.596763"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:23.600386"], ["updated_at", "2019-06-23 22:29:23.600386"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:23.603342"], ["updated_at", "2019-06-23 22:29:23.603342"], ["synced_id", 2], ["host", "example2.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:23.608155"], ["updated_at", "2019-06-23 22:29:23.608155"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:23.612601"], ["updated_at", "2019-06-23 22:29:23.612601"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:23.617796"], ["updated_at", "2019-06-23 22:29:23.617796"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:23.622369"], ["updated_at", "2019-06-23 22:29:23.622369"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:23.624448"], ["updated_at", "2019-06-23 22:29:23.624448"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:23.626221"], ["updated_at", "2019-06-23 22:29:23.626221"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:23.628010"], ["updated_at", "2019-06-23 22:29:23.628010"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:23.632833"], ["updated_at", "2019-06-23 22:29:23.632833"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.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.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:45.157478"], ["updated_at", "2019-06-23 22:29:45.157478"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:45.180335"], ["updated_at", "2019-06-23 22:29:45.180335"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:45.184781"], ["updated_at", "2019-06-23 22:29:45.184781"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:45.201026"], ["updated_at", "2019-06-23 22:29:45.201026"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:45.203703"], ["updated_at", "2019-06-23 22:29:45.203703"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:45.205444"], ["updated_at", "2019-06-23 22:29:45.205444"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:29:45.211126"], ["updated_at", "2019-06-23 22:29:45.211126"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:29:55.003609"], ["updated_at", "2019-06-23 22:29:55.003609"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:29:55.005146"], ["synced_id", 0], ["id", 838]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:29:56.007388"], ["updated_at", "2019-06-23 22:29:56.007388"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "customized_key" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:29:56.008981"], ["customized_key", 0], ["id", 839]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:29:56.025017"], ["updated_at", "2019-06-23 22:29:56.025017"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242596"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:29:56.044884"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 840]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) SAVEPOINT active_record_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-06-23 22:29:56.052807"], ["updated_at", "2019-06-23 22:29:56.052807"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415396"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.059980"], ["updated_at", "2019-06-23 22:29:56.059980"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:29:56.064820"], ["updated_at", "2019-06-23 22:29:56.064820"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.068171"], ["updated_at", "2019-06-23 22:29:56.068171"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:29:56.070772"], ["updated_at", "2019-06-23 22:29:56.070772"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.073702"], ["updated_at", "2019-06-23 22:29:56.073702"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:29:56.076057"], ["updated_at", "2019-06-23 22:29:56.076057"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_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-06-23 22:29:56.083113"], ["updated_at", "2019-06-23 22:29:56.083113"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:29:56.087006"], ["updated_at", "2019-06-23 22:29:56.087006"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.090160"], ["updated_at", "2019-06-23 22:29:56.090160"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.091736"], ["updated_at", "2019-06-23 22:29:56.091736"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Update (0.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-06-23 22:29:56.093846"], ["id", 851]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 851], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.100786"], ["updated_at", "2019-06-23 22:29:56.100786"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.102700"], ["updated_at", "2019-06-23 22:29:56.102700"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Update (0.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-06-23 22:29:56.105028"], ["id", 853]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 853], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.108673"], ["updated_at", "2019-06-23 22:29:56.108673"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.110097"], ["updated_at", "2019-06-23 22:29:56.110097"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) 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 Update (0.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-06-23 22:29:56.114916"], ["id", 855]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.119640"], ["updated_at", "2019-06-23 22:29:56.119640"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.121029"], ["updated_at", "2019-06-23 22:29:56.121029"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Update (0.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-06-23 22:29:56.122876"], ["id", 857]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:56.125866"], ["updated_at", "2019-06-23 22:29:56.125866"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:56.127141"], ["updated_at", "2019-06-23 22:29:56.127141"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:56.128898"], ["updated_at", "2019-06-23 22:29:56.128898"], ["synced_id", 3]]  (0.3ms) 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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:29:56.135957"], ["updated_at", "2019-06-23 22:29:56.135957"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 861], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) 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-06-23 22:29:56.138393"], ["id", 861]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 861], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) 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 6ms (Views: 5.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (1.9ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:29:56.178118"], ["updated_at", "2019-06-23 22:29:56.178118"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.7ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_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-06-23 22:29:56.187425"], ["updated_at", "2019-06-23 22:29:56.187425"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:56.213908"], ["updated_at", "2019-06-23 22:29:56.213908"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 2.5ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:29:56.222406"], ["updated_at", "2019-06-23 22:29:56.222406"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.6ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 4ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.245269"], ["updated_at", "2019-06-23 22:29:56.245269"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:29:56.250603"], ["updated_at", "2019-06-23 22:29:56.250603"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.255544"], ["updated_at", "2019-06-23 22:29:56.255544"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.257579"], ["updated_at", "2019-06-23 22:29:56.257579"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.266481"], ["updated_at", "2019-06-23 22:29:56.266481"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.277634"], ["updated_at", "2019-06-23 22:29:56.277634"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.285188"], ["updated_at", "2019-06-23 22:29:56.285188"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.296149"], ["updated_at", "2019-06-23 22:29:56.296149"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.303124"], ["updated_at", "2019-06-23 22:29:56.303124"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.314156"], ["updated_at", "2019-06-23 22:29:56.314156"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.320579"], ["updated_at", "2019-06-23 22:29:56.320579"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.322653"], ["updated_at", "2019-06-23 22:29:56.322653"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.325276"], ["updated_at", "2019-06-23 22:29:56.325276"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.327151"], ["updated_at", "2019-06-23 22:29:56.327151"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:56.332094"], ["updated_at", "2019-06-23 22:29:56.332094"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415396"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.334998"], ["updated_at", "2019-06-23 22:29:56.334998"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:56.339198"], ["updated_at", "2019-06-23 22:29:56.339198"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242596"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.342856"], ["updated_at", "2019-06-23 22:29:56.342856"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 910], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:29:56.359614"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 910]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.364041"], ["updated_at", "2019-06-23 22:29:56.364041"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.368739"], ["updated_at", "2019-06-23 22:29:56.368739"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.373964"], ["updated_at", "2019-06-23 22:29:56.373964"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-23 22:29:56.378918"], ["updated_at", "2019-06-23 22:29:56.378918"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.384192"], ["updated_at", "2019-06-23 22:29:56.384192"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:56.389017"], ["updated_at", "2019-06-23 22:29:56.389017"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:56.392066"], ["updated_at", "2019-06-23 22:29:56.392066"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_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", 913], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:29:56.396589"], ["id", 913]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.400873"], ["updated_at", "2019-06-23 22:29:56.400873"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.402770"], ["updated_at", "2019-06-23 22:29:56.402770"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 915], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:29:56.405648"], ["id", 915]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 915], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.410175"], ["updated_at", "2019-06-23 22:29:56.410175"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:56.412858"], ["updated_at", "2019-06-23 22:29:56.412858"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 917], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:29:56.416039"], ["id", 917]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 917], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:56.419963"], ["updated_at", "2019-06-23 22:29:56.419963"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.421859"], ["updated_at", "2019-06-23 22:29:56.421859"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.425540"], ["updated_at", "2019-06-23 22:29:56.425540"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.430719"], ["updated_at", "2019-06-23 22:29:56.430719"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.432769"], ["updated_at", "2019-06-23 22:29:56.432769"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.436668"], ["updated_at", "2019-06-23 22:29:56.436668"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.438712"], ["updated_at", "2019-06-23 22:29:56.438712"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.442992"], ["updated_at", "2019-06-23 22:29:56.442992"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.445245"], ["updated_at", "2019-06-23 22:29:56.445245"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:29:56.449321"], ["updated_at", "2019-06-23 22:29:56.449321"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.451201"], ["updated_at", "2019-06-23 22:29:56.451201"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.455847"], ["updated_at", "2019-06-23 22:29:56.455847"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.459463"], ["updated_at", "2019-06-23 22:29:56.459463"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.464313"], ["updated_at", "2019-06-23 22:29:56.464313"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:29:56.467279"], ["updated_at", "2019-06-23 22:29:56.467279"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.484589"], ["updated_at", "2019-06-23 22:29:56.484589"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.486617"], ["updated_at", "2019-06-23 22:29:56.486617"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.488482"], ["updated_at", "2019-06-23 22:29:56.488482"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:29:56.490424"], ["updated_at", "2019-06-23 22:29:56.490424"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.494839"], ["updated_at", "2019-06-23 22:29:56.494839"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:29:56.504255"], ["updated_at", "2019-06-23 22:29:56.504255"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 937], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 937], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:29:56.508325"], ["id", 937]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 937], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (6.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-23 22:30:23.552002"], ["updated_at", "2019-06-23 22:30:23.552002"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.3ms) BEGIN  (0.6ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:23.638499"], ["updated_at", "2019-06-23 22:30:23.638499"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:23.642982"], ["updated_at", "2019-06-23 22:30:23.642982"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:23.678231"], ["updated_at", "2019-06-23 22:30:23.678231"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:23.680147"], ["updated_at", "2019-06-23 22:30:23.680147"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:23.682062"], ["updated_at", "2019-06-23 22:30:23.682062"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:30:23.686410"], ["updated_at", "2019-06-23 22:30:23.686410"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 871], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 871], ["LIMIT", 1]] Account Update (0.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-06-23 22:30:23.692693"], ["id", 871]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 871], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:30:23.699332"], ["updated_at", "2019-06-23 22:30:23.699332"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.702887"], ["updated_at", "2019-06-23 22:30:23.702887"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:30:23.706028"], ["updated_at", "2019-06-23 22:30:23.706028"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.710423"], ["updated_at", "2019-06-23 22:30:23.710423"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:30:23.719970"], ["updated_at", "2019-06-23 22:30:23.719970"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.725571"], ["updated_at", "2019-06-23 22:30:23.725571"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 22:30:23.730732"], ["updated_at", "2019-06-23 22:30:23.730732"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.743546"], ["updated_at", "2019-06-23 22:30:23.743546"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:30:23.750658"], ["updated_at", "2019-06-23 22:30:23.750658"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.756327"], ["updated_at", "2019-06-23 22:30:23.756327"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.758951"], ["updated_at", "2019-06-23 22:30:23.758951"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 882], ["LIMIT", 1]] Account Update (0.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-06-23 22:30:23.764732"], ["id", 882]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.770191"], ["updated_at", "2019-06-23 22:30:23.770191"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.773423"], ["updated_at", "2019-06-23 22:30:23.773423"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 884], ["LIMIT", 1]] Account Update (0.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-06-23 22:30:23.776810"], ["id", 884]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 884], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.783725"], ["updated_at", "2019-06-23 22:30:23.783725"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.787079"], ["updated_at", "2019-06-23 22:30:23.787079"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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-06-23 22:30:23.791509"], ["id", 886]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 886], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.799910"], ["updated_at", "2019-06-23 22:30:23.799910"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:23.803029"], ["updated_at", "2019-06-23 22:30:23.803029"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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.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-06-23 22:30:23.807096"], ["id", 888]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (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", 123], ["LIMIT", 1]] Account Create (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:23.814769"], ["updated_at", "2019-06-23 22:30:23.814769"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:30:36.293088"], ["updated_at", "2019-06-23 22:30:36.293088"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:30:36.294896"], ["synced_id", 0], ["id", 890]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:30:37.938429"], ["updated_at", "2019-06-23 22:30:37.938429"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "customized_key" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:30:37.939940"], ["customized_key", 0], ["id", 891]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:30:37.956882"], ["updated_at", "2019-06-23 22:30:37.956882"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415437"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:30:37.960129"], ["updated_at", "2019-06-23 22:30:37.960129"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242637"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:30:37.979022"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 893]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:37.982100"], ["updated_at", "2019-06-23 22:30:37.982100"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:37.983500"], ["updated_at", "2019-06-23 22:30:37.983500"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:37.984703"], ["updated_at", "2019-06-23 22:30:37.984703"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["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-06-23 22:30:37.996073"], ["updated_at", "2019-06-23 22:30:37.996073"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.022415"], ["updated_at", "2019-06-23 22:30:38.022415"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.026920"], ["updated_at", "2019-06-23 22:30:38.026920"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.029026"], ["updated_at", "2019-06-23 22:30:38.029026"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.031357"], ["updated_at", "2019-06-23 22:30:38.031357"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.037068"], ["updated_at", "2019-06-23 22:30:38.037068"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.041439"], ["updated_at", "2019-06-23 22:30:38.041439"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 943], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 943], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:30:38.044765"], ["id", 943]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 943], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.050011"], ["updated_at", "2019-06-23 22:30:38.050011"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.052982"], ["updated_at", "2019-06-23 22:30:38.052982"], ["synced_id", 2], ["host", "example.test"]]  (0.4ms) 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", 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-06-23 22:30:38.059259"], ["updated_at", "2019-06-23 22:30:38.059259"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.064155"], ["updated_at", "2019-06-23 22:30:38.064155"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) 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.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.075565"], ["updated_at", "2019-06-23 22:30:38.075565"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.083678"], ["updated_at", "2019-06-23 22:30:38.083678"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) 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.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-06-23 22:30:38.107795"], ["updated_at", "2019-06-23 22:30:38.107795"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-23 22:30:38.111938"], ["updated_at", "2019-06-23 22:30:38.111938"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.119092"], ["updated_at", "2019-06-23 22:30:38.119092"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.3ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.126119"], ["updated_at", "2019-06-23 22:30:38.126119"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.128610"], ["updated_at", "2019-06-23 22:30:38.128610"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.132415"], ["updated_at", "2019-06-23 22:30:38.132415"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.134493"], ["updated_at", "2019-06-23 22:30:38.134493"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.140084"], ["updated_at", "2019-06-23 22:30:38.140084"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:30:38.143332"], ["updated_at", "2019-06-23 22:30:38.143332"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.146723"], ["updated_at", "2019-06-23 22:30:38.146723"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.148533"], ["updated_at", "2019-06-23 22:30:38.148533"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 958], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:30:38.151176"], ["id", 958]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.155786"], ["updated_at", "2019-06-23 22:30:38.155786"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.158467"], ["updated_at", "2019-06-23 22:30:38.158467"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 960], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:30:38.161711"], ["id", 960]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 960], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:30:38.165501"], ["updated_at", "2019-06-23 22:30:38.165501"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.167517"], ["updated_at", "2019-06-23 22:30:38.167517"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 962], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:30:38.171006"], ["id", 962]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 962], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.175963"], ["updated_at", "2019-06-23 22:30:38.175963"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.178336"], ["updated_at", "2019-06-23 22:30:38.178336"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.182902"], ["updated_at", "2019-06-23 22:30:38.182902"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.186069"], ["updated_at", "2019-06-23 22:30:38.186069"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:30:38.191164"], ["updated_at", "2019-06-23 22:30:38.191164"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242638"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.194502"], ["updated_at", "2019-06-23 22:30:38.194502"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 967], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:30:38.211026"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 967]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:38.214439"], ["updated_at", "2019-06-23 22:30:38.214439"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415438"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.217220"], ["updated_at", "2019-06-23 22:30:38.217220"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:30:38.222169"], ["updated_at", "2019-06-23 22:30:38.222169"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.230780"], ["updated_at", "2019-06-23 22:30:38.230780"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.233674"], ["updated_at", "2019-06-23 22:30:38.233674"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.237783"], ["updated_at", "2019-06-23 22:30:38.237783"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:30:38.244388"], ["updated_at", "2019-06-23 22:30:38.244388"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.7ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:30:38.249022"], ["updated_at", "2019-06-23 22:30:38.249022"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 2ms (ActiveRecord: 0.6ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one 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.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-06-23 22:30:38.259700"], ["updated_at", "2019-06-23 22:30:38.259700"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:30:38.268257"], ["updated_at", "2019-06-23 22:30:38.268257"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.8ms)  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 4ms (Views: 2.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.291970"], ["updated_at", "2019-06-23 22:30:38.291970"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.299510"], ["updated_at", "2019-06-23 22:30:38.299510"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.307673"], ["updated_at", "2019-06-23 22:30:38.307673"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.315640"], ["updated_at", "2019-06-23 22:30:38.315640"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.327990"], ["updated_at", "2019-06-23 22:30:38.327990"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:38.339004"], ["updated_at", "2019-06-23 22:30:38.339004"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:38.349252"], ["updated_at", "2019-06-23 22:30:38.349252"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.355262"], ["updated_at", "2019-06-23 22:30:38.355262"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:38.357728"], ["updated_at", "2019-06-23 22:30:38.357728"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 22:30:42.971673"], ["updated_at", "2019-06-23 22:30:42.971673"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 42ms (ActiveRecord: 12.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:30:42.978461"], ["updated_at", "2019-06-23 22:30:42.978461"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:42.999197"], ["updated_at", "2019-06-23 22:30:42.999197"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 2.4ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:30:43.009285"], ["updated_at", "2019-06-23 22:30:43.009285"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 3.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:43.047126"], ["updated_at", "2019-06-23 22:30:43.047126"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:43.052407"], ["updated_at", "2019-06-23 22:30:43.052407"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:43.069171"], ["updated_at", "2019-06-23 22:30:43.069171"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:43.078418"], ["updated_at", "2019-06-23 22:30:43.078418"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:43.091943"], ["updated_at", "2019-06-23 22:30:43.091943"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:43.109279"], ["updated_at", "2019-06-23 22:30:43.109279"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:43.121439"], ["updated_at", "2019-06-23 22:30:43.121439"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) 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 (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:30:43.147900"], ["updated_at", "2019-06-23 22:30:43.147900"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:43.161312"], ["updated_at", "2019-06-23 22:30:43.161312"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:43.164197"], ["updated_at", "2019-06-23 22:30:43.164197"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:43.166880"], ["updated_at", "2019-06-23 22:30:43.166880"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:43.172883"], ["updated_at", "2019-06-23 22:30:43.172883"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:43.178379"], ["updated_at", "2019-06-23 22:30:43.178379"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.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.3ms) 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", 909], ["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-06-23 22:30:43.188056"], ["id", 909]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:43.197335"], ["updated_at", "2019-06-23 22:30:43.197335"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:43.199212"], ["updated_at", "2019-06-23 22:30:43.199212"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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-06-23 22:30:43.203277"], ["id", 911]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 911], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:43.214771"], ["updated_at", "2019-06-23 22:30:43.214771"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:43.217529"], ["updated_at", "2019-06-23 22:30:43.217529"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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.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-06-23 22:30:43.222297"], ["id", 913]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 913], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-23 22:30:43.231527"], ["updated_at", "2019-06-23 22:30:43.231527"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:43.238191"], ["updated_at", "2019-06-23 22:30:43.238191"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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.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-06-23 22:30:43.245102"], ["id", 915]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:43.249984"], ["updated_at", "2019-06-23 22:30:43.249984"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:30:43.266128"], ["updated_at", "2019-06-23 22:30:43.266128"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:43.269597"], ["updated_at", "2019-06-23 22:30:43.269597"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:30:43.271870"], ["updated_at", "2019-06-23 22:30:43.271870"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:43.276752"], ["updated_at", "2019-06-23 22:30:43.276752"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:30:43.281645"], ["updated_at", "2019-06-23 22:30:43.281645"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:43.287935"], ["updated_at", "2019-06-23 22:30:43.287935"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:30:43.292155"], ["updated_at", "2019-06-23 22:30:43.292155"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:43.297648"], ["updated_at", "2019-06-23 22:30:43.297648"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:30:47.774015"], ["updated_at", "2019-06-23 22:30:47.774015"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:30:47.775571"], ["synced_id", 0], ["id", 925]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:30:53.266703"], ["updated_at", "2019-06-23 22:30:53.266703"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "customized_key" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:30:53.268240"], ["customized_key", 0], ["id", 926]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:30:53.284906"], ["updated_at", "2019-06-23 22:30:53.284906"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 927], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Update (0.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-06-23 22:30:53.287897"], ["id", 927]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 927], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:30:53.291486"], ["updated_at", "2019-06-23 22:30:53.291486"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415453"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:30:53.294332"], ["updated_at", "2019-06-23 22:30:53.294332"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242653"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Update (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:30:53.322022"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 929]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:53.329611"], ["updated_at", "2019-06-23 22:30:53.329611"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:53.332975"], ["updated_at", "2019-06-23 22:30:53.332975"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:53.351431"], ["updated_at", "2019-06-23 22:30:53.351431"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:53.353471"], ["updated_at", "2019-06-23 22:30:53.353471"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:53.354804"], ["updated_at", "2019-06-23 22:30:53.354804"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.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)  (0.3ms) 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 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.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 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.391289"], ["updated_at", "2019-06-23 22:30:53.391289"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.393718"], ["updated_at", "2019-06-23 22:30:53.393718"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.403882"], ["updated_at", "2019-06-23 22:30:53.403882"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.406254"], ["updated_at", "2019-06-23 22:30:53.406254"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.409810"], ["updated_at", "2019-06-23 22:30:53.409810"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.417174"], ["updated_at", "2019-06-23 22:30:53.417174"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.419496"], ["updated_at", "2019-06-23 22:30:53.419496"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.423776"], ["updated_at", "2019-06-23 22:30:53.423776"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.426126"], ["updated_at", "2019-06-23 22:30:53.426126"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.6ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "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-06-23 22:30:53.432406"], ["updated_at", "2019-06-23 22:30:53.432406"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.435198"], ["updated_at", "2019-06-23 22:30:53.435198"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:30:53.438727"], ["updated_at", "2019-06-23 22:30:53.438727"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.440824"], ["updated_at", "2019-06-23 22:30:53.440824"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 986], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:30:53.443997"], ["id", 986]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:30:53.448566"], ["updated_at", "2019-06-23 22:30:53.448566"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.450553"], ["updated_at", "2019-06-23 22:30:53.450553"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 988], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:30:53.453679"], ["id", 988]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 988], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:30:53.457757"], ["updated_at", "2019-06-23 22:30:53.457757"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.459985"], ["updated_at", "2019-06-23 22:30:53.459985"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 990], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:30:53.463304"], ["id", 990]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 990], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:30:53.468331"], ["updated_at", "2019-06-23 22:30:53.468331"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242653"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:53.471293"], ["updated_at", "2019-06-23 22:30:53.471293"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 992], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:30:53.487713"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 992]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:30:53.491289"], ["updated_at", "2019-06-23 22:30:53.491289"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415453"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:53.494518"], ["updated_at", "2019-06-23 22:30:53.494518"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.499471"], ["updated_at", "2019-06-23 22:30:53.499471"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.501959"], ["updated_at", "2019-06-23 22:30:53.501959"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.504001"], ["updated_at", "2019-06-23 22:30:53.504001"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.505762"], ["updated_at", "2019-06-23 22:30:53.505762"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:53.511991"], ["updated_at", "2019-06-23 22:30:53.511991"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.517521"], ["updated_at", "2019-06-23 22:30:53.517521"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.519518"], ["updated_at", "2019-06-23 22:30:53.519518"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.521302"], ["updated_at", "2019-06-23 22:30:53.521302"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.523096"], ["updated_at", "2019-06-23 22:30:53.523096"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.527062"], ["updated_at", "2019-06-23 22:30:53.527062"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1002], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1002], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:30:53.530920"], ["id", 1002]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1002], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.535487"], ["updated_at", "2019-06-23 22:30:53.535487"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.543174"], ["updated_at", "2019-06-23 22:30:53.543174"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:53.549039"], ["updated_at", "2019-06-23 22:30:53.549039"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.571847"], ["updated_at", "2019-06-23 22:30:53.571847"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:30:53.575676"], ["updated_at", "2019-06-23 22:30:53.575676"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-23 22:30:53.579469"], ["updated_at", "2019-06-23 22:30:53.579469"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.589100"], ["updated_at", "2019-06-23 22:30:53.589100"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["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.9ms) 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-06-23 22:30:53.600966"], ["updated_at", "2019-06-23 22:30:53.600966"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:30:53.606526"], ["updated_at", "2019-06-23 22:30:53.606526"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:30:53.622191"], ["updated_at", "2019-06-23 22:30:53.622191"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.628738"], ["updated_at", "2019-06-23 22:30:53.628738"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:30:53.632844"], ["updated_at", "2019-06-23 22:30:53.632844"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 8.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) 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.2ms) SAVEPOINT active_record_1 Account Exists (0.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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 22:31:46.612727"], ["updated_at", "2019-06-23 22:31:46.612727"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 40ms (ActiveRecord: 11.9ms)  (0.2ms) ROLLBACK  (0.4ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:31:46.621864"], ["updated_at", "2019-06-23 22:31:46.621864"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:31:46.640073"], ["updated_at", "2019-06-23 22:31:46.640073"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.2ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (1.6ms) 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"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:31:46.665666"], ["updated_at", "2019-06-23 22:31:46.665666"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 3.3ms)  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-23 22:31:46.692829"], ["updated_at", "2019-06-23 22:31:46.692829"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 1ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:31:46.727982"], ["updated_at", "2019-06-23 22:31:46.727982"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.738579"], ["updated_at", "2019-06-23 22:31:46.738579"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.741558"], ["updated_at", "2019-06-23 22:31:46.741558"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:31:46.764455"], ["updated_at", "2019-06-23 22:31:46.764455"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:31:46.787672"], ["updated_at", "2019-06-23 22:31:46.787672"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:31:46.809161"], ["updated_at", "2019-06-23 22:31:46.809161"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:31:46.840399"], ["updated_at", "2019-06-23 22:31:46.840399"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:31:46.847126"], ["updated_at", "2019-06-23 22:31:46.847126"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:31:46.855145"], ["updated_at", "2019-06-23 22:31:46.855145"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.865147"], ["updated_at", "2019-06-23 22:31:46.865147"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:31:46.869179"], ["updated_at", "2019-06-23 22:31:46.869179"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.874622"], ["updated_at", "2019-06-23 22:31:46.874622"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:31:46.877080"], ["updated_at", "2019-06-23 22:31:46.877080"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.880206"], ["updated_at", "2019-06-23 22:31:46.880206"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:31:46.883920"], ["updated_at", "2019-06-23 22:31:46.883920"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.887235"], ["updated_at", "2019-06-23 22:31:46.887235"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 22:31:46.890067"], ["updated_at", "2019-06-23 22:31:46.890067"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.893172"], ["updated_at", "2019-06-23 22:31:46.893172"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.894941"], ["updated_at", "2019-06-23 22:31:46.894941"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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 (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-06-23 22:31:46.897758"], ["id", 949]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 949], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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-06-23 22:31:46.903207"], ["updated_at", "2019-06-23 22:31:46.903207"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.905615"], ["updated_at", "2019-06-23 22:31:46.905615"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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-06-23 22:31:46.907905"], ["id", 951]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 951], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.911636"], ["updated_at", "2019-06-23 22:31:46.911636"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.913696"], ["updated_at", "2019-06-23 22:31:46.913696"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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 (0.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-06-23 22:31:46.916974"], ["id", 953]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.920293"], ["updated_at", "2019-06-23 22:31:46.920293"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:31:46.922667"], ["updated_at", "2019-06-23 22:31:46.922667"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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-06-23 22:31:46.924938"], ["id", 955]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:31:46.927963"], ["updated_at", "2019-06-23 22:31:46.927963"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:31:46.931103"], ["updated_at", "2019-06-23 22:31:46.931103"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:31:46.933587"], ["updated_at", "2019-06-23 22:31:46.933587"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:31:46.935392"], ["updated_at", "2019-06-23 22:31:46.935392"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 22:31:46.939455"], ["updated_at", "2019-06-23 22:31:46.939455"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 960], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 960], ["LIMIT", 1]] Account Update (0.2ms) 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-06-23 22:31:46.943452"], ["id", 960]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 960], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:31:46.951704"], ["updated_at", "2019-06-23 22:31:46.951704"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:31:46.953045"], ["synced_id", 0], ["id", 961]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 22:33:15.826949"], ["updated_at", "2019-06-23 22:33:15.826949"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "customized_key" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 22:33:15.828441"], ["customized_key", 0], ["id", 962]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:33:15.866640"], ["updated_at", "2019-06-23 22:33:15.866640"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415595"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:33:15.870362"], ["updated_at", "2019-06-23 22:33:15.870362"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242795"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Account Update (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 22:33:15.893104"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 964]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:33:15.901668"], ["updated_at", "2019-06-23 22:33:15.901668"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.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-06-23 22:33:15.923233"], ["updated_at", "2019-06-23 22:33:15.923233"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:33:15.926993"], ["updated_at", "2019-06-23 22:33:15.926993"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:33:15.928616"], ["updated_at", "2019-06-23 22:33:15.928616"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:33:15.930763"], ["updated_at", "2019-06-23 22:33:15.930763"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 22:33:15.934450"], ["updated_at", "2019-06-23 22:33:15.934450"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:33:15.941373"], ["updated_at", "2019-06-23 22:33:15.941373"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561242795"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:33:15.945497"], ["updated_at", "2019-06-23 22:33:15.945497"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (2.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1013], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-23 22:33:15.970014"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1013]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:33:15.973848"], ["updated_at", "2019-06-23 22:33:15.973848"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561415595"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:33:15.976975"], ["updated_at", "2019-06-23 22:33:15.976975"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:33:15.981438"], ["updated_at", "2019-06-23 22:33:15.981438"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:33:15.986192"], ["updated_at", "2019-06-23 22:33:15.986192"], ["synced_id", 2], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:33:15.989722"], ["updated_at", "2019-06-23 22:33:15.989722"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:33:15.993680"], ["updated_at", "2019-06-23 22:33:15.993680"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) 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.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:33:16.003511"], ["updated_at", "2019-06-23 22:33:16.003511"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:33:16.009687"], ["updated_at", "2019-06-23 22:33:16.009687"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:33:16.012962"], ["updated_at", "2019-06-23 22:33:16.012962"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:33:16.017164"], ["updated_at", "2019-06-23 22:33:16.017164"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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-06-23 22:33:16.020669"], ["updated_at", "2019-06-23 22:33:16.020669"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:33:16.028221"], ["updated_at", "2019-06-23 22:33:16.028221"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.030208"], ["updated_at", "2019-06-23 22:33:16.030208"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1023], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:33:16.033189"], ["id", 1023]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.036521"], ["updated_at", "2019-06-23 22:33:16.036521"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (4.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.043657"], ["updated_at", "2019-06-23 22:33:16.043657"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1025], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:33:16.047259"], ["id", 1025]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1025], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 22:33:16.052155"], ["updated_at", "2019-06-23 22:33:16.052155"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_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-06-23 22:33:16.056993"], ["updated_at", "2019-06-23 22:33:16.056993"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1027], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.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-06-23 22:33:16.061532"], ["id", 1027]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1027], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.072108"], ["updated_at", "2019-06-23 22:33:16.072108"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.075293"], ["updated_at", "2019-06-23 22:33:16.075293"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.079270"], ["updated_at", "2019-06-23 22:33:16.079270"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.085956"], ["updated_at", "2019-06-23 22:33:16.085956"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.090341"], ["updated_at", "2019-06-23 22:33:16.090341"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.095365"], ["updated_at", "2019-06-23 22:33:16.095365"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.097335"], ["updated_at", "2019-06-23 22:33:16.097335"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.101955"], ["updated_at", "2019-06-23 22:33:16.101955"], ["provider", "bookingsync"], ["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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 22:33:16.107097"], ["updated_at", "2019-06-23 22:33:16.107097"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:33:16.111254"], ["updated_at", "2019-06-23 22:33:16.111254"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:33:16.114068"], ["updated_at", "2019-06-23 22:33:16.114068"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:33:16.133275"], ["updated_at", "2019-06-23 22:33:16.133275"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) 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.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-06-23 22:33:16.140867"], ["updated_at", "2019-06-23 22:33:16.140867"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1039], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1039], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 22:33:16.144389"], ["id", 1039]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1039], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:33:16.149030"], ["updated_at", "2019-06-23 22:33:16.149030"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:33:16.152012"], ["updated_at", "2019-06-23 22:33:16.152012"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 22:33:16.156507"], ["updated_at", "2019-06-23 22:33:16.156507"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:33:16.160476"], ["updated_at", "2019-06-23 22:33:16.160476"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:33:16.162982"], ["updated_at", "2019-06-23 22:33:16.162982"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:33:16.164959"], ["updated_at", "2019-06-23 22:33:16.164959"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 22:33:16.166784"], ["updated_at", "2019-06-23 22:33:16.166784"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-23 22:33:16.172467"], ["updated_at", "2019-06-23 22:33:16.172467"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) 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-06-23 23:16:15.233947"], ["updated_at", "2019-06-23 23:16:15.233947"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-23 23:16:15.251591"], ["updated_at", "2019-06-23 23:16:15.251591"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.261841"], ["updated_at", "2019-06-23 23:16:15.261841"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.281824"], ["updated_at", "2019-06-23 23:16:15.281824"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.299465"], ["updated_at", "2019-06-23 23:16:15.299465"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.311700"], ["updated_at", "2019-06-23 23:16:15.311700"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:15.367487"], ["updated_at", "2019-06-23 23:16:15.367487"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 23:16:15.394451"], ["updated_at", "2019-06-23 23:16:15.394451"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:15.406552"], ["updated_at", "2019-06-23 23:16:15.406552"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:16:15.412140"], ["updated_at", "2019-06-23 23:16:15.412140"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561245375"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 23:16:15.434581"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 974]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:16:15.440400"], ["updated_at", "2019-06-23 23:16:15.440400"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561418175"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 23:16:15.449678"], ["updated_at", "2019-06-23 23:16:15.449678"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 23:16:15.452256"], ["synced_id", 0], ["id", 976]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.463956"], ["updated_at", "2019-06-23 23:16:15.463956"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 23:16:15.469341"], ["updated_at", "2019-06-23 23:16:15.469341"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.476496"], ["updated_at", "2019-06-23 23:16:15.476496"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 23:16:15.493737"], ["updated_at", "2019-06-23 23:16:15.493737"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) 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-06-23 23:16:15.507602"], ["updated_at", "2019-06-23 23:16:15.507602"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 23:16:15.511822"], ["updated_at", "2019-06-23 23:16:15.511822"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.514687"], ["updated_at", "2019-06-23 23:16:15.514687"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 23:16:15.517301"], ["updated_at", "2019-06-23 23:16:15.517301"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.520983"], ["updated_at", "2019-06-23 23:16:15.520983"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-23 23:16:15.523414"], ["updated_at", "2019-06-23 23:16:15.523414"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 23:16:15.527593"], ["updated_at", "2019-06-23 23:16:15.527593"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.532091"], ["updated_at", "2019-06-23 23:16:15.532091"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.534162"], ["updated_at", "2019-06-23 23:16:15.534162"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 23:16:15.536778"], ["updated_at", "2019-06-23 23:16:15.536778"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 989], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.543235"], ["updated_at", "2019-06-23 23:16:15.543235"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.545321"], ["updated_at", "2019-06-23 23:16:15.545321"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 23:16:15.547778"], ["updated_at", "2019-06-23 23:16:15.547778"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 992], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.551923"], ["updated_at", "2019-06-23 23:16:15.551923"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.553831"], ["updated_at", "2019-06-23 23:16:15.553831"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 23:16:15.557404"], ["updated_at", "2019-06-23 23:16:15.557404"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 23:16:15.562826"], ["updated_at", "2019-06-23 23:16:15.562826"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 997], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 997], ["LIMIT", 1]] Account Update (0.2ms) 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-06-23 23:16:15.565468"], ["id", 997]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 997], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:15.568870"], ["updated_at", "2019-06-23 23:16:15.568870"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:15.570452"], ["updated_at", "2019-06-23 23:16:15.570452"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:15.572365"], ["updated_at", "2019-06-23 23:16:15.572365"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:15.577648"], ["updated_at", "2019-06-23 23:16:15.577648"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:15.580565"], ["updated_at", "2019-06-23 23:16:15.580565"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:15.582153"], ["updated_at", "2019-06-23 23:16:15.582153"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:15.583637"], ["updated_at", "2019-06-23 23:16:15.583637"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.610058"], ["updated_at", "2019-06-23 23:16:15.610058"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (4.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.612270"], ["updated_at", "2019-06-23 23:16:15.612270"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.619262"], ["updated_at", "2019-06-23 23:16:15.619262"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.621377"], ["updated_at", "2019-06-23 23:16:15.621377"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."customized_key" = $2 LIMIT $3 [["host", "example2.test"], ["customized_key", 1], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:15.629250"], ["updated_at", "2019-06-23 23:16:15.629250"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561418175"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.637255"], ["updated_at", "2019-06-23 23:16:15.637255"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:15.643649"], ["updated_at", "2019-06-23 23:16:15.643649"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561245375"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.648223"], ["updated_at", "2019-06-23 23:16:15.648223"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1051], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-23 23:16:15.666147"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1051]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.669797"], ["updated_at", "2019-06-23 23:16:15.669797"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.674602"], ["updated_at", "2019-06-23 23:16:15.674602"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.695755"], ["updated_at", "2019-06-23 23:16:15.695755"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.698515"], ["updated_at", "2019-06-23 23:16:15.698515"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.701197"], ["updated_at", "2019-06-23 23:16:15.701197"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.705104"], ["updated_at", "2019-06-23 23:16:15.705104"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.706909"], ["updated_at", "2019-06-23 23:16:15.706909"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.708651"], ["updated_at", "2019-06-23 23:16:15.708651"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.711134"], ["updated_at", "2019-06-23 23:16:15.711134"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."customized_key" = $2 LIMIT $3 [["host", "example2.test"], ["customized_key", 1], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.716903"], ["updated_at", "2019-06-23 23:16:15.716903"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.721390"], ["updated_at", "2019-06-23 23:16:15.721390"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.725360"], ["updated_at", "2019-06-23 23:16:15.725360"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:15.730311"], ["updated_at", "2019-06-23 23:16:15.730311"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:15.739243"], ["updated_at", "2019-06-23 23:16:15.739243"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1060], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1060], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 23:16:15.742352"], ["id", 1060]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1060], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:15.751817"], ["updated_at", "2019-06-23 23:16:15.751817"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:15.755102"], ["updated_at", "2019-06-23 23:16:15.755102"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 23:16:15.761630"], ["updated_at", "2019-06-23 23:16:15.761630"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) [34mSELECT COUNT(*) FROM "multi_applications_accounts"  (0.5ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 23:16:15.771384"], ["updated_at", "2019-06-23 23:16:15.771384"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:15.774698"], ["updated_at", "2019-06-23 23:16:15.774698"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 23:16:15.780637"], ["updated_at", "2019-06-23 23:16:15.780637"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:15.782626"], ["updated_at", "2019-06-23 23:16:15.782626"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 23:16:15.786402"], ["updated_at", "2019-06-23 23:16:15.786402"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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-06-23 23:16:15.789066"], ["updated_at", "2019-06-23 23:16:15.789066"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:15.794778"], ["updated_at", "2019-06-23 23:16:15.794778"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:15.797533"], ["updated_at", "2019-06-23 23:16:15.797533"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 23:16:15.800546"], ["updated_at", "2019-06-23 23:16:15.800546"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:15.807400"], ["updated_at", "2019-06-23 23:16:15.807400"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:15.810127"], ["updated_at", "2019-06-23 23:16:15.810127"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 23:16:15.813786"], ["updated_at", "2019-06-23 23:16:15.813786"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1073], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:15.817706"], ["updated_at", "2019-06-23 23:16:15.817706"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:15.819531"], ["updated_at", "2019-06-23 23:16:15.819531"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 23:16:15.823179"], ["updated_at", "2019-06-23 23:16:15.823179"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1076], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:15.828239"], ["updated_at", "2019-06-23 23:16:15.828239"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:15.830190"], ["updated_at", "2019-06-23 23:16:15.830190"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:15.834812"], ["updated_at", "2019-06-23 23:16:15.834812"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.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 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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: 0.8ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:15.860126"], ["updated_at", "2019-06-23 23:16:15.860126"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:15.874545"], ["updated_at", "2019-06-23 23:16:15.874545"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.879876"], ["updated_at", "2019-06-23 23:16:15.879876"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:15.881743"], ["updated_at", "2019-06-23 23:16:15.881743"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."customized_key" = $2 LIMIT $3 [["host", "test.host"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 3.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 23:16:15.898728"], ["updated_at", "2019-06-23 23:16:15.898728"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 23:16:15.904200"], ["updated_at", "2019-06-23 23:16:15.904200"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-23 23:16:15.913345"], ["updated_at", "2019-06-23 23:16:15.913345"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-23 23:16:15.920714"], ["updated_at", "2019-06-23 23:16:15.920714"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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: 0.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) 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 (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:48.038823"], ["updated_at", "2019-06-23 23:16:48.038823"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:48.042552"], ["updated_at", "2019-06-23 23:16:48.042552"], ["synced_id", 2]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:48.045836"], ["updated_at", "2019-06-23 23:16:48.045836"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:48.051593"], ["updated_at", "2019-06-23 23:16:48.051593"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:48.087325"], ["updated_at", "2019-06-23 23:16:48.087325"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:48.090597"], ["updated_at", "2019-06-23 23:16:48.090597"], ["synced_id", 2]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:48.093749"], ["updated_at", "2019-06-23 23:16:48.093749"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 23:16:48.100818"], ["updated_at", "2019-06-23 23:16:48.100818"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 23:16:48.102259"], ["synced_id", 0], ["id", 1016]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 23:16:48.111837"], ["updated_at", "2019-06-23 23:16:48.111837"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:48.118472"], ["updated_at", "2019-06-23 23:16:48.118472"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.132872"], ["updated_at", "2019-06-23 23:16:48.132872"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.140029"], ["updated_at", "2019-06-23 23:16:48.140029"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1020], ["LIMIT", 1]] Account Update (0.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-06-23 23:16:48.142896"], ["id", 1020]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.146774"], ["updated_at", "2019-06-23 23:16:48.146774"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.148432"], ["updated_at", "2019-06-23 23:16:48.148432"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1022], ["LIMIT", 1]] Account Update (0.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-06-23 23:16:48.150689"], ["id", 1022]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1022], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.154229"], ["updated_at", "2019-06-23 23:16:48.154229"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-23 23:16:48.157168"], ["updated_at", "2019-06-23 23:16:48.157168"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 1024], ["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-06-23 23:16:48.162311"], ["id", 1024]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1024], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.173469"], ["updated_at", "2019-06-23 23:16:48.173469"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.178165"], ["updated_at", "2019-06-23 23:16:48.178165"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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-06-23 23:16:48.182485"], ["id", 1026]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.187754"], ["updated_at", "2019-06-23 23:16:48.187754"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:16:48.194189"], ["updated_at", "2019-06-23 23:16:48.194189"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.199977"], ["updated_at", "2019-06-23 23:16:48.199977"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:16:48.204190"], ["updated_at", "2019-06-23 23:16:48.204190"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.210615"], ["updated_at", "2019-06-23 23:16:48.210615"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:16:48.214416"], ["updated_at", "2019-06-23 23:16:48.214416"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.219350"], ["updated_at", "2019-06-23 23:16:48.219350"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:16:48.222873"], ["updated_at", "2019-06-23 23:16:48.222873"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 23:16:48.228807"], ["updated_at", "2019-06-23 23:16:48.228807"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1035], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1035], ["LIMIT", 1]] Account Update (0.2ms) 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-06-23 23:16:48.233409"], ["id", 1035]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1035], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:48.239429"], ["updated_at", "2019-06-23 23:16:48.239429"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:16:48.246398"], ["updated_at", "2019-06-23 23:16:48.246398"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561418208"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:16:48.251544"], ["updated_at", "2019-06-23 23:16:48.251544"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561245408"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1038], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 23:16:48.270175"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1038]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.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-06-23 23:16:48.328118"], ["updated_at", "2019-06-23 23:16:48.328118"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561245408"], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.332156"], ["updated_at", "2019-06-23 23:16:48.332156"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1085], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-23 23:16:48.348291"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1085]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:48.352028"], ["updated_at", "2019-06-23 23:16:48.352028"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561418208"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.355209"], ["updated_at", "2019-06-23 23:16:48.355209"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.358973"], ["updated_at", "2019-06-23 23:16:48.358973"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1087], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1087], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 23:16:48.362764"], ["id", 1087]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1087], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.367536"], ["updated_at", "2019-06-23 23:16:48.367536"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.369410"], ["updated_at", "2019-06-23 23:16:48.369410"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.371113"], ["updated_at", "2019-06-23 23:16:48.371113"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.373579"], ["updated_at", "2019-06-23 23:16:48.373579"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.378396"], ["updated_at", "2019-06-23 23:16:48.378396"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.381752"], ["updated_at", "2019-06-23 23:16:48.381752"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.398318"], ["updated_at", "2019-06-23 23:16:48.398318"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.401368"], ["updated_at", "2019-06-23 23:16:48.401368"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.404947"], ["updated_at", "2019-06-23 23:16:48.404947"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.406715"], ["updated_at", "2019-06-23 23:16:48.406715"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1094], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 23:16:48.409360"], ["id", 1094]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:48.412664"], ["updated_at", "2019-06-23 23:16:48.412664"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.414996"], ["updated_at", "2019-06-23 23:16:48.414996"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1096], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 23:16:48.417472"], ["id", 1096]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1096], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.421168"], ["updated_at", "2019-06-23 23:16:48.421168"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:48.423790"], ["updated_at", "2019-06-23 23:16:48.423790"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1098], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 23:16:48.426829"], ["id", 1098]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1098], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:48.431455"], ["updated_at", "2019-06-23 23:16:48.431455"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.433436"], ["updated_at", "2019-06-23 23:16:48.433436"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.436294"], ["updated_at", "2019-06-23 23:16:48.436294"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.441644"], ["updated_at", "2019-06-23 23:16:48.441644"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.443596"], ["updated_at", "2019-06-23 23:16:48.443596"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.448114"], ["updated_at", "2019-06-23 23:16:48.448114"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.450148"], ["updated_at", "2019-06-23 23:16:48.450148"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.453550"], ["updated_at", "2019-06-23 23:16:48.453550"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:48.455935"], ["updated_at", "2019-06-23 23:16:48.455935"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.459752"], ["updated_at", "2019-06-23 23:16:48.459752"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.461603"], ["updated_at", "2019-06-23 23:16:48.461603"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.466685"], ["updated_at", "2019-06-23 23:16:48.466685"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.470093"], ["updated_at", "2019-06-23 23:16:48.470093"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.474627"], ["updated_at", "2019-06-23 23:16:48.474627"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.478311"], ["updated_at", "2019-06-23 23:16:48.478311"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.483139"], ["updated_at", "2019-06-23 23:16:48.483139"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.485320"], ["updated_at", "2019-06-23 23:16:48.485320"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.487401"], ["updated_at", "2019-06-23 23:16:48.487401"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.490557"], ["updated_at", "2019-06-23 23:16:48.490557"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.495947"], ["updated_at", "2019-06-23 23:16:48.495947"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:16:48.500522"], ["updated_at", "2019-06-23 23:16:48.500522"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:16:48.515599"], ["updated_at", "2019-06-23 23:16:48.515599"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.525612"], ["updated_at", "2019-06-23 23:16:48.525612"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:16:48.527527"], ["updated_at", "2019-06-23 23:16:48.527527"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.534009"], ["updated_at", "2019-06-23 23:16:48.534009"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 6ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.1ms) Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:16:48.565301"], ["updated_at", "2019-06-23 23:16:48.565301"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:16:48.570779"], ["updated_at", "2019-06-23 23:16:48.570779"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:16:48.579976"], ["updated_at", "2019-06-23 23:16:48.579976"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:16:48.587753"], ["updated_at", "2019-06-23 23:16:48.587753"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.595712"], ["updated_at", "2019-06-23 23:16:48.595712"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.604159"], ["updated_at", "2019-06-23 23:16:48.604159"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.618030"], ["updated_at", "2019-06-23 23:16:48.618030"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.626206"], ["updated_at", "2019-06-23 23:16:48.626206"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.633055"], ["updated_at", "2019-06-23 23:16:48.633055"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:16:48.645261"], ["updated_at", "2019-06-23 23:16:48.645261"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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-06-23 23:17:11.997995"], ["updated_at", "2019-06-23 23:17:11.997995"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:17:12.003031"], ["updated_at", "2019-06-23 23:17:12.003031"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561418232"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:17:12.007914"], ["updated_at", "2019-06-23 23:17:12.007914"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561245432"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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 (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-23 23:17:12.041533"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1045]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:17:12.059956"], ["updated_at", "2019-06-23 23:17:12.059956"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:17:12.062878"], ["updated_at", "2019-06-23 23:17:12.062878"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:17:12.065768"], ["updated_at", "2019-06-23 23:17:12.065768"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:17:12.071978"], ["updated_at", "2019-06-23 23:17:12.071978"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:17:12.074101"], ["updated_at", "2019-06-23 23:17:12.074101"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:17:12.076093"], ["updated_at", "2019-06-23 23:17:12.076093"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 23:17:12.081699"], ["updated_at", "2019-06-23 23:17:12.081699"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:17:12.089395"], ["updated_at", "2019-06-23 23:17:12.089395"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-23 23:17:12.092826"], ["updated_at", "2019-06-23 23:17:12.092826"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1054], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1054], ["LIMIT", 1]] Account Update (0.2ms) 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-06-23 23:17:12.096213"], ["id", 1054]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1054], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:17:12.117683"], ["updated_at", "2019-06-23 23:17:12.117683"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) 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.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.140187"], ["updated_at", "2019-06-23 23:17:12.140187"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.142362"], ["updated_at", "2019-06-23 23:17:12.142362"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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", 1057], ["LIMIT", 1]] Account Update (0.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-06-23 23:17:12.147673"], ["id", 1057]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1057], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.152385"], ["updated_at", "2019-06-23 23:17:12.152385"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.154213"], ["updated_at", "2019-06-23 23:17:12.154213"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1059], ["LIMIT", 1]] Account Update (0.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-06-23 23:17:12.156945"], ["id", 1059]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1059], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (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", 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-06-23 23:17:12.164978"], ["updated_at", "2019-06-23 23:17:12.164978"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.167991"], ["updated_at", "2019-06-23 23:17:12.167991"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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.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-06-23 23:17:12.170670"], ["id", 1061]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.174381"], ["updated_at", "2019-06-23 23:17:12.174381"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.176449"], ["updated_at", "2019-06-23 23:17:12.176449"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.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.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-06-23 23:17:12.180405"], ["id", 1063]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.184432"], ["updated_at", "2019-06-23 23:17:12.184432"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:17:12.187250"], ["updated_at", "2019-06-23 23:17:12.187250"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.190712"], ["updated_at", "2019-06-23 23:17:12.190712"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:17:12.193029"], ["updated_at", "2019-06-23 23:17:12.193029"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.197960"], ["updated_at", "2019-06-23 23:17:12.197960"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:17:12.200977"], ["updated_at", "2019-06-23 23:17:12.200977"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.203786"], ["updated_at", "2019-06-23 23:17:12.203786"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:17:12.206249"], ["updated_at", "2019-06-23 23:17:12.206249"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-23 23:17:12.214957"], ["updated_at", "2019-06-23 23:17:12.214957"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-23 23:17:12.216486"], ["synced_id", 0], ["id", 1072]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.250025"], ["updated_at", "2019-06-23 23:17:12.250025"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.270383"], ["updated_at", "2019-06-23 23:17:12.270383"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.284693"], ["updated_at", "2019-06-23 23:17:12.284693"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.297674"], ["updated_at", "2019-06-23 23:17:12.297674"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.318752"], ["updated_at", "2019-06-23 23:17:12.318752"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.349426"], ["updated_at", "2019-06-23 23:17:12.349426"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.358984"], ["updated_at", "2019-06-23 23:17:12.358984"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-23 23:17:12.373869"], ["updated_at", "2019-06-23 23:17:12.373869"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.390372"], ["updated_at", "2019-06-23 23:17:12.390372"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.392747"], ["updated_at", "2019-06-23 23:17:12.392747"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:17:12.407044"], ["updated_at", "2019-06-23 23:17:12.407044"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.409431"], ["updated_at", "2019-06-23 23:17:12.409431"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:17:12.415026"], ["updated_at", "2019-06-23 23:17:12.415026"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.417683"], ["updated_at", "2019-06-23 23:17:12.417683"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1125], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 23:17:12.421633"], ["id", 1125]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:17:12.426294"], ["updated_at", "2019-06-23 23:17:12.426294"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.428592"], ["updated_at", "2019-06-23 23:17:12.428592"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1127], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 23:17:12.431806"], ["id", 1127]]  (0.1ms) 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", 1127], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:17:12.441704"], ["updated_at", "2019-06-23 23:17:12.441704"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.443775"], ["updated_at", "2019-06-23 23:17:12.443775"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1129], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 23:17:12.446360"], ["id", 1129]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1129], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.450514"], ["updated_at", "2019-06-23 23:17:12.450514"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.452382"], ["updated_at", "2019-06-23 23:17:12.452382"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) 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.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-06-23 23:17:12.457148"], ["updated_at", "2019-06-23 23:17:12.457148"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.4ms) ROLLBACK  (0.4ms) BEGIN MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.468767"], ["updated_at", "2019-06-23 23:17:12.468767"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.471275"], ["updated_at", "2019-06-23 23:17:12.471275"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.474992"], ["updated_at", "2019-06-23 23:17:12.474992"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.477016"], ["updated_at", "2019-06-23 23:17:12.477016"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.480652"], ["updated_at", "2019-06-23 23:17:12.480652"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:17:12.483836"], ["updated_at", "2019-06-23 23:17:12.483836"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.488583"], ["updated_at", "2019-06-23 23:17:12.488583"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.491796"], ["updated_at", "2019-06-23 23:17:12.491796"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.494677"], ["updated_at", "2019-06-23 23:17:12.494677"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.500680"], ["updated_at", "2019-06-23 23:17:12.500680"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.503539"], ["updated_at", "2019-06-23 23:17:12.503539"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.508040"], ["updated_at", "2019-06-23 23:17:12.508040"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.509823"], ["updated_at", "2019-06-23 23:17:12.509823"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.511553"], ["updated_at", "2019-06-23 23:17:12.511553"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.513780"], ["updated_at", "2019-06-23 23:17:12.513780"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.520304"], ["updated_at", "2019-06-23 23:17:12.520304"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-23 23:17:12.525079"], ["updated_at", "2019-06-23 23:17:12.525079"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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 (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.540473"], ["updated_at", "2019-06-23 23:17:12.540473"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.544860"], ["updated_at", "2019-06-23 23:17:12.544860"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.571742"], ["updated_at", "2019-06-23 23:17:12.571742"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (4.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-06-23 23:17:12.575136"], ["updated_at", "2019-06-23 23:17:12.575136"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1149], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1149], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 23:17:12.583149"], ["id", 1149]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1149], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.587241"], ["updated_at", "2019-06-23 23:17:12.587241"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561245432"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.590144"], ["updated_at", "2019-06-23 23:17:12.590144"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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", 1150], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-23 23:17:12.611807"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1150]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.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-06-23 23:17:12.617164"], ["updated_at", "2019-06-23 23:17:12.617164"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561418232"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-23 23:17:12.622101"], ["updated_at", "2019-06-23 23:17:12.622101"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.625712"], ["updated_at", "2019-06-23 23:17:12.625712"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.627516"], ["updated_at", "2019-06-23 23:17:12.627516"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.629207"], ["updated_at", "2019-06-23 23:17:12.629207"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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", 2], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-23 23:17:12.631769"], ["updated_at", "2019-06-23 23:17:12.631769"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.6ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:17:12.640808"], ["updated_at", "2019-06-23 23:17:12.640808"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:17:12.646174"], ["updated_at", "2019-06-23 23:17:12.646174"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-23 23:17:12.655504"], ["updated_at", "2019-06-23 23:17:12.655504"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-23 23:17:12.662669"], ["updated_at", "2019-06-23 23:17:12.662669"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 4.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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.8ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms) ROLLBACK  (0.4ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 07:41:49.637389"], ["updated_at", "2019-06-24 07:41:49.637389"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 78ms (ActiveRecord: 31.5ms)  (0.2ms) ROLLBACK  (0.1ms) 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.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.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-06-24 07:41:49.651695"], ["updated_at", "2019-06-24 07:41:49.651695"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 2.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-24 07:41:49.661260"], ["updated_at", "2019-06-24 07:41:49.661260"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.5ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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-06-24 07:41:49.689349"], ["updated_at", "2019-06-24 07:41:49.689349"], ["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.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 3.5ms)  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 07:41:49.699815"], ["updated_at", "2019-06-24 07:41:49.699815"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.707988"], ["updated_at", "2019-06-24 07:41:49.707988"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.711906"], ["updated_at", "2019-06-24 07:41:49.711906"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 4ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.750073"], ["updated_at", "2019-06-24 07:41:49.750073"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.752731"], ["updated_at", "2019-06-24 07:41:49.752731"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.756494"], ["updated_at", "2019-06-24 07:41:49.756494"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.760564"], ["updated_at", "2019-06-24 07:41:49.760564"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.766965"], ["updated_at", "2019-06-24 07:41:49.766965"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:49.787022"], ["updated_at", "2019-06-24 07:41:49.787022"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) 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.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:49.792973"], ["updated_at", "2019-06-24 07:41:49.792973"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.801159"], ["updated_at", "2019-06-24 07:41:49.801159"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1165], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1165], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (5.6ms) 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-06-24 07:41:49.810152"], ["id", 1165]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1165], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 07:41:49.824502"], ["updated_at", "2019-06-24 07:41:49.824502"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 07:41:49.856370"], ["updated_at", "2019-06-24 07:41:49.856370"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561448509"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:49.859313"], ["updated_at", "2019-06-24 07:41:49.859313"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.864612"], ["updated_at", "2019-06-24 07:41:49.864612"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561275709"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:49.867456"], ["updated_at", "2019-06-24 07:41:49.867456"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1168], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 07:41:49.899656"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1168]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.903097"], ["updated_at", "2019-06-24 07:41:49.903097"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:49.906049"], ["updated_at", "2019-06-24 07:41:49.906049"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.910426"], ["updated_at", "2019-06-24 07:41:49.910426"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.913324"], ["updated_at", "2019-06-24 07:41:49.913324"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.915457"], ["updated_at", "2019-06-24 07:41:49.915457"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:49.917742"], ["updated_at", "2019-06-24 07:41:49.917742"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 07:41:49.921968"], ["updated_at", "2019-06-24 07:41:49.921968"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.923992"], ["updated_at", "2019-06-24 07:41:49.923992"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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-06-24 07:41:49.931662"], ["updated_at", "2019-06-24 07:41:49.931662"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.934510"], ["updated_at", "2019-06-24 07:41:49.934510"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.937840"], ["updated_at", "2019-06-24 07:41:49.937840"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.943484"], ["updated_at", "2019-06-24 07:41:49.943484"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.945543"], ["updated_at", "2019-06-24 07:41:49.945543"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.955236"], ["updated_at", "2019-06-24 07:41:49.955236"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.957747"], ["updated_at", "2019-06-24 07:41:49.957747"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) 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.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-06-24 07:41:49.964789"], ["updated_at", "2019-06-24 07:41:49.964789"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.967607"], ["updated_at", "2019-06-24 07:41:49.967607"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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-06-24 07:41:49.977343"], ["updated_at", "2019-06-24 07:41:49.977343"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.982429"], ["updated_at", "2019-06-24 07:41:49.982429"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1185], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 07:41:49.985444"], ["id", 1185]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:49.989580"], ["updated_at", "2019-06-24 07:41:49.989580"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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-06-24 07:41:49.992245"], ["updated_at", "2019-06-24 07:41:49.992245"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) 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"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1187], ["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-06-24 07:41:49.998031"], ["id", 1187]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1187], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:50.004070"], ["updated_at", "2019-06-24 07:41:50.004070"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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", 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-06-24 07:41:50.009432"], ["updated_at", "2019-06-24 07:41:50.009432"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1189], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 07:41:50.014323"], ["id", 1189]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1189], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:50.019917"], ["updated_at", "2019-06-24 07:41:50.019917"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 07:41:50.042084"], ["updated_at", "2019-06-24 07:41:50.042084"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.047914"], ["updated_at", "2019-06-24 07:41:50.047914"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:50.051338"], ["updated_at", "2019-06-24 07:41:50.051338"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 07:41:50.071123"], ["updated_at", "2019-06-24 07:41:50.071123"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561448510"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-24 07:41:50.074471"], ["updated_at", "2019-06-24 07:41:50.074471"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561275710"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1082], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-24 07:41:50.091642"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1082]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-24 07:41:50.099107"], ["updated_at", "2019-06-24 07:41:50.099107"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-24 07:41:50.100501"], ["synced_id", 0], ["id", 1083]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 07:41:50.105357"], ["updated_at", "2019-06-24 07:41:50.105357"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.111370"], ["updated_at", "2019-06-24 07:41:50.111370"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.113772"], ["updated_at", "2019-06-24 07:41:50.113772"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1086], ["LIMIT", 1]] Account Update (0.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-06-24 07:41:50.116271"], ["id", 1086]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1086], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.120833"], ["updated_at", "2019-06-24 07:41:50.120833"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.122576"], ["updated_at", "2019-06-24 07:41:50.122576"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 1088], ["LIMIT", 1]] Account Update (0.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-06-24 07:41:50.125685"], ["id", 1088]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1088], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.130897"], ["updated_at", "2019-06-24 07:41:50.130897"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.132592"], ["updated_at", "2019-06-24 07:41:50.132592"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1090], ["LIMIT", 1]] Account Update (0.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-06-24 07:41:50.134904"], ["id", 1090]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.138080"], ["updated_at", "2019-06-24 07:41:50.138080"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.139785"], ["updated_at", "2019-06-24 07:41:50.139785"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1092], ["LIMIT", 1]] Account Update (0.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-06-24 07:41:50.143427"], ["id", 1092]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.147742"], ["updated_at", "2019-06-24 07:41:50.147742"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 07:41:50.151198"], ["updated_at", "2019-06-24 07:41:50.151198"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.154461"], ["updated_at", "2019-06-24 07:41:50.154461"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 07:41:50.156838"], ["updated_at", "2019-06-24 07:41:50.156838"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.161716"], ["updated_at", "2019-06-24 07:41:50.161716"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 07:41:50.165931"], ["updated_at", "2019-06-24 07:41:50.165931"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 07:41:50.169445"], ["updated_at", "2019-06-24 07:41:50.169445"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 07:41:50.172261"], ["updated_at", "2019-06-24 07:41:50.172261"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 07:41:50.176755"], ["updated_at", "2019-06-24 07:41:50.176755"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1101], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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.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-06-24 07:41:50.181690"], ["id", 1101]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1101], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 07:41:50.186319"], ["updated_at", "2019-06-24 07:41:50.186319"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 07:41:50.203758"], ["updated_at", "2019-06-24 07:41:50.203758"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 07:41:50.205592"], ["updated_at", "2019-06-24 07:41:50.205592"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 07:41:50.207351"], ["updated_at", "2019-06-24 07:41:50.207351"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 07:41:50.212445"], ["updated_at", "2019-06-24 07:41:50.212445"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 07:41:50.215765"], ["updated_at", "2019-06-24 07:41:50.215765"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 07:41:50.219170"], ["updated_at", "2019-06-24 07:41:50.219170"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 07:41:50.220981"], ["updated_at", "2019-06-24 07:41:50.220981"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 07:41:50.222632"], ["updated_at", "2019-06-24 07:41:50.222632"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:50.227208"], ["updated_at", "2019-06-24 07:41:50.227208"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:50.256908"], ["updated_at", "2019-06-24 07:41:50.256908"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:50.268005"], ["updated_at", "2019-06-24 07:41:50.268005"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) 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-06-24 07:41:50.276771"], ["updated_at", "2019-06-24 07:41:50.276771"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:50.286371"], ["updated_at", "2019-06-24 07:41:50.286371"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:50.295415"], ["updated_at", "2019-06-24 07:41:50.295415"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 07:41:50.307648"], ["updated_at", "2019-06-24 07:41:50.307648"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (1.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:01:56.597663"], ["updated_at", "2019-06-24 11:01:56.597663"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.623620"], ["updated_at", "2019-06-24 11:01:56.623620"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.626514"], ["updated_at", "2019-06-24 11:01:56.626514"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:56.641276"], ["updated_at", "2019-06-24 11:01:56.641276"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:56.657196"], ["updated_at", "2019-06-24 11:01:56.657196"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:56.671472"], ["updated_at", "2019-06-24 11:01:56.671472"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:56.693121"], ["updated_at", "2019-06-24 11:01:56.693121"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) 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.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:56.706020"], ["updated_at", "2019-06-24 11:01:56.706020"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.4ms) 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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:56.730152"], ["updated_at", "2019-06-24 11:01:56.730152"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.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-06-24 11:01:56.750340"], ["updated_at", "2019-06-24 11:01:56.750340"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (1.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.760673"], ["updated_at", "2019-06-24 11:01:56.760673"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:56.765623"], ["updated_at", "2019-06-24 11:01:56.765623"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:56.776886"], ["updated_at", "2019-06-24 11:01:56.776886"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.813026"], ["updated_at", "2019-06-24 11:01:56.813026"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.814934"], ["updated_at", "2019-06-24 11:01:56.814934"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.817046"], ["updated_at", "2019-06-24 11:01:56.817046"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.818823"], ["updated_at", "2019-06-24 11:01:56.818823"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.822306"], ["updated_at", "2019-06-24 11:01:56.822306"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:56.826272"], ["updated_at", "2019-06-24 11:01:56.826272"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.849813"], ["updated_at", "2019-06-24 11:01:56.849813"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:01:56.858604"], ["updated_at", "2019-06-24 11:01:56.858604"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.860446"], ["updated_at", "2019-06-24 11:01:56.860446"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1202], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 11:01:56.863425"], ["id", 1202]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.868263"], ["updated_at", "2019-06-24 11:01:56.868263"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.871332"], ["updated_at", "2019-06-24 11:01:56.871332"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1204], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 11:01:56.875008"], ["id", 1204]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1204], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.879105"], ["updated_at", "2019-06-24 11:01:56.879105"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.880963"], ["updated_at", "2019-06-24 11:01:56.880963"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1206], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 11:01:56.883593"], ["id", 1206]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1206], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:01:56.888587"], ["updated_at", "2019-06-24 11:01:56.888587"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.890911"], ["updated_at", "2019-06-24 11:01:56.890911"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.894611"], ["updated_at", "2019-06-24 11:01:56.894611"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.899138"], ["updated_at", "2019-06-24 11:01:56.899138"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.901389"], ["updated_at", "2019-06-24 11:01:56.901389"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "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.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-06-24 11:01:56.907956"], ["updated_at", "2019-06-24 11:01:56.907956"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.910305"], ["updated_at", "2019-06-24 11:01:56.910305"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.914436"], ["updated_at", "2019-06-24 11:01:56.914436"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.916632"], ["updated_at", "2019-06-24 11:01:56.916632"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:01:56.920970"], ["updated_at", "2019-06-24 11:01:56.920970"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.924163"], ["updated_at", "2019-06-24 11:01:56.924163"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.929893"], ["updated_at", "2019-06-24 11:01:56.929893"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.931718"], ["updated_at", "2019-06-24 11:01:56.931718"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.933456"], ["updated_at", "2019-06-24 11:01:56.933456"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.935529"], ["updated_at", "2019-06-24 11:01:56.935529"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) 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 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:56.942661"], ["updated_at", "2019-06-24 11:01:56.942661"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:56.945909"], ["updated_at", "2019-06-24 11:01:56.945909"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:56.949097"], ["updated_at", "2019-06-24 11:01:56.949097"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:01:56.952819"], ["updated_at", "2019-06-24 11:01:56.952819"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.960885"], ["updated_at", "2019-06-24 11:01:56.960885"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1225], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1225], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 11:01:56.969629"], ["id", 1225]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1225], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:56.978205"], ["updated_at", "2019-06-24 11:01:56.978205"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561287716"], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) 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.3ms) 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-06-24 11:01:56.985827"], ["updated_at", "2019-06-24 11:01:56.985827"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_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", 1226], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-24 11:01:57.007929"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1226]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:01:57.012431"], ["updated_at", "2019-06-24 11:01:57.012431"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561460517"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:01:57.015436"], ["updated_at", "2019-06-24 11:01:57.015436"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:01:57.025314"], ["updated_at", "2019-06-24 11:01:57.025314"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 7ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:01:57.036334"], ["updated_at", "2019-06-24 11:01:57.036334"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:01:57.047810"], ["updated_at", "2019-06-24 11:01:57.047810"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.6ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:01:57.062223"], ["updated_at", "2019-06-24 11:01:57.062223"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.8ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-24 11:01:57.118034"], ["updated_at", "2019-06-24 11:01:57.118034"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-24 11:01:57.120331"], ["synced_id", 0], ["id", 1115]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:01:57.127455"], ["updated_at", "2019-06-24 11:01:57.127455"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 11:01:57.146328"], ["updated_at", "2019-06-24 11:01:57.146328"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:01:57.150005"], ["updated_at", "2019-06-24 11:01:57.150005"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561287717"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1118], ["LIMIT", 1]] Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-24 11:01:57.169873"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1118]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:01:57.174899"], ["updated_at", "2019-06-24 11:01:57.174899"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561460517"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 11:01:57.178940"], ["updated_at", "2019-06-24 11:01:57.178940"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1120], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1120], ["LIMIT", 1]] Account Update (0.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-06-24 11:01:57.182287"], ["id", 1120]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1120], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:01:57.186067"], ["updated_at", "2019-06-24 11:01:57.186067"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:01:57.189636"], ["updated_at", "2019-06-24 11:01:57.189636"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:01:57.192086"], ["updated_at", "2019-06-24 11:01:57.192086"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:01:57.193983"], ["updated_at", "2019-06-24 11:01:57.193983"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:57.198200"], ["updated_at", "2019-06-24 11:01:57.198200"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:01:57.202553"], ["updated_at", "2019-06-24 11:01:57.202553"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:57.209412"], ["updated_at", "2019-06-24 11:01:57.209412"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:01:57.213080"], ["updated_at", "2019-06-24 11:01:57.213080"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:57.216885"], ["updated_at", "2019-06-24 11:01:57.216885"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:01:57.220316"], ["updated_at", "2019-06-24 11:01:57.220316"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:57.224327"], ["updated_at", "2019-06-24 11:01:57.224327"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:01:57.227098"], ["updated_at", "2019-06-24 11:01:57.227098"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:57.230303"], ["updated_at", "2019-06-24 11:01:57.230303"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:57.237962"], ["updated_at", "2019-06-24 11:01:57.237962"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1134], ["LIMIT", 1]] Account Update (0.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-06-24 11:01:57.241406"], ["id", 1134]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1134], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:57.245305"], ["updated_at", "2019-06-24 11:01:57.245305"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:57.247450"], ["updated_at", "2019-06-24 11:01:57.247450"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1136], ["LIMIT", 1]] Account Update (0.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-06-24 11:01:57.250195"], ["id", 1136]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1136], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) 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-06-24 11:01:57.256441"], ["updated_at", "2019-06-24 11:01:57.256441"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:57.260596"], ["updated_at", "2019-06-24 11:01:57.260596"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.3ms) 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]]  (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", 1138], ["LIMIT", 1]] Account Update (0.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-06-24 11:01:57.271847"], ["id", 1138]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:57.278820"], ["updated_at", "2019-06-24 11:01:57.278820"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:01:57.280714"], ["updated_at", "2019-06-24 11:01:57.280714"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1140], ["LIMIT", 1]] Account Update (0.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-06-24 11:01:57.283516"], ["id", 1140]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-24 11:01:57.287948"], ["updated_at", "2019-06-24 11:01:57.287948"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:01:57.292919"], ["updated_at", "2019-06-24 11:01:57.292919"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:01:57.295687"], ["updated_at", "2019-06-24 11:01:57.295687"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:01:57.299703"], ["updated_at", "2019-06-24 11:01:57.299703"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (1.0ms) 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.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.108901"], ["updated_at", "2019-06-24 11:02:49.108901"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.126864"], ["updated_at", "2019-06-24 11:02:49.126864"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.153497"], ["updated_at", "2019-06-24 11:02:49.153497"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.160138"], ["updated_at", "2019-06-24 11:02:49.160138"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.167442"], ["updated_at", "2019-06-24 11:02:49.167442"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-24 11:02:49.177240"], ["updated_at", "2019-06-24 11:02:49.177240"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.190869"], ["updated_at", "2019-06-24 11:02:49.190869"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 7ms (Views: 7.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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: 0.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1  (1.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.host"], ["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:02:49.292634"], ["updated_at", "2019-06-24 11:02:49.292634"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "test.host"], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:02:49.298252"], ["updated_at", "2019-06-24 11:02:49.298252"], ["synced_id", 123], ["host", "test.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "123"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "123"], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "123"], ["host", "123"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:02:49.358958"], ["updated_at", "2019-06-24 11:02:49.358958"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "123"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.4ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 6ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-24 11:02:49.403649"], ["updated_at", "2019-06-24 11:02:49.403649"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-24 11:02:49.410231"], ["synced_id", 0], ["id", 1145]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "test.example"], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:02:49.474125"], ["updated_at", "2019-06-24 11:02:49.474125"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-24 11:02:49.477451"], ["updated_at", "2019-06-24 11:02:49.477451"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "test.example"], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:02:49.504977"], ["updated_at", "2019-06-24 11:02:49.504977"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.509640"], ["updated_at", "2019-06-24 11:02:49.509640"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.515066"], ["updated_at", "2019-06-24 11:02:49.515066"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example2.test"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.517291"], ["updated_at", "2019-06-24 11:02:49.517291"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "123"], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "123"], ["host", "123"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:02:49.520747"], ["updated_at", "2019-06-24 11:02:49.520747"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "123"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "123"], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "123"], ["host", "123"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:02:49.525190"], ["updated_at", "2019-06-24 11:02:49.525190"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "123"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example2.test"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.527250"], ["updated_at", "2019-06-24 11:02:49.527250"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "123"], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "123"], ["host", "123"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:02:49.534028"], ["updated_at", "2019-06-24 11:02:49.534028"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "123"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example2.test"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.536314"], ["updated_at", "2019-06-24 11:02:49.536314"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "123"], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "123"], ["host", "123"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:02:49.540372"], ["updated_at", "2019-06-24 11:02:49.540372"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "123"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example2.test"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.542525"], ["updated_at", "2019-06-24 11:02:49.542525"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.547006"], ["updated_at", "2019-06-24 11:02:49.547006"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example2.test"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.549291"], ["updated_at", "2019-06-24 11:02:49.549291"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "123"], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "123"], ["host", "123"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:02:49.552458"], ["updated_at", "2019-06-24 11:02:49.552458"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "123"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.557356"], ["updated_at", "2019-06-24 11:02:49.557356"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example2.test"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.559330"], ["updated_at", "2019-06-24 11:02:49.559330"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "123"], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "123"], ["host", "123"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:02:49.563381"], ["updated_at", "2019-06-24 11:02:49.563381"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "123"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1246], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.568818"], ["updated_at", "2019-06-24 11:02:49.568818"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example2.test"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.570883"], ["updated_at", "2019-06-24 11:02:49.570883"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 LIMIT $3 [["host", "123"], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "123"], ["host", "123"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:02:49.573621"], ["updated_at", "2019-06-24 11:02:49.573621"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "123"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1249], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.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-06-24 11:02:49.578427"], ["updated_at", "2019-06-24 11:02:49.578427"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example2.test"], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.581794"], ["updated_at", "2019-06-24 11:02:49.581794"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.587364"], ["updated_at", "2019-06-24 11:02:49.587364"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:02:49.591084"], ["updated_at", "2019-06-24 11:02:49.591084"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.597541"], ["updated_at", "2019-06-24 11:02:49.597541"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1256], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["host", "example.test"], ["id", 1256], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 11:02:49.602710"], ["id", 1256]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1256], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.608282"], ["updated_at", "2019-06-24 11:02:49.608282"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.613805"], ["updated_at", "2019-06-24 11:02:49.613805"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:02:49.618085"], ["updated_at", "2019-06-24 11:02:49.618085"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.623327"], ["updated_at", "2019-06-24 11:02:49.623327"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561460569"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.626226"], ["updated_at", "2019-06-24 11:02:49.626226"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "example.test"], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:02:49.631345"], ["updated_at", "2019-06-24 11:02:49.631345"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561287769"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.635208"], ["updated_at", "2019-06-24 11:02:49.635208"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["host", "example.test"], ["id", 1260], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 11:02:49.651866"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1260]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["host", "test.example"], ["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:02:49.655060"], ["updated_at", "2019-06-24 11:02:49.655060"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.657892"], ["updated_at", "2019-06-24 11:02:49.657892"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:02:49.660531"], ["updated_at", "2019-06-24 11:02:49.660531"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" 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-06-24 11:03:29.090645"], ["updated_at", "2019-06-24 11:03:29.090645"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-24 11:03:29.104655"], ["updated_at", "2019-06-24 11:03:29.104655"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-24 11:03:29.106195"], ["synced_id", 0], ["id", 1147]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:03:29.142147"], ["updated_at", "2019-06-24 11:03:29.142147"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:03:29.146108"], ["updated_at", "2019-06-24 11:03:29.146108"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 11:03:29.151371"], ["updated_at", "2019-06-24 11:03:29.151371"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1150], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1150], ["LIMIT", 1]] Account Update (0.2ms) 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-06-24 11:03:29.155701"], ["id", 1150]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1150], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["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-06-24 11:03:29.160661"], ["updated_at", "2019-06-24 11:03:29.160661"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561287809"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1151], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-24 11:03:29.185329"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1151]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 11:03:29.189163"], ["updated_at", "2019-06-24 11:03:29.189163"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561460609"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:03:29.209017"], ["updated_at", "2019-06-24 11:03:29.209017"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:03:29.215525"], ["updated_at", "2019-06-24 11:03:29.215525"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:03:29.219822"], ["updated_at", "2019-06-24 11:03:29.219822"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.250905"], ["updated_at", "2019-06-24 11:03:29.250905"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:03:29.256067"], ["updated_at", "2019-06-24 11:03:29.256067"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["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-06-24 11:03:29.266674"], ["updated_at", "2019-06-24 11:03:29.266674"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:03:29.271927"], ["updated_at", "2019-06-24 11:03:29.271927"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["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-06-24 11:03:29.277481"], ["updated_at", "2019-06-24 11:03:29.277481"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:03:29.285989"], ["updated_at", "2019-06-24 11:03:29.285989"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.290573"], ["updated_at", "2019-06-24 11:03:29.290573"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:03:29.297322"], ["updated_at", "2019-06-24 11:03:29.297322"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.305937"], ["updated_at", "2019-06-24 11:03:29.305937"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.317883"], ["updated_at", "2019-06-24 11:03:29.317883"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.326344"], ["updated_at", "2019-06-24 11:03:29.326344"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.334637"], ["updated_at", "2019-06-24 11:03:29.334637"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.388418"], ["updated_at", "2019-06-24 11:03:29.388418"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.392473"], ["updated_at", "2019-06-24 11:03:29.392473"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.396146"], ["updated_at", "2019-06-24 11:03:29.396146"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.415652"], ["updated_at", "2019-06-24 11:03:29.415652"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561460609"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.418760"], ["updated_at", "2019-06-24 11:03:29.418760"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.423292"], ["updated_at", "2019-06-24 11:03:29.423292"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561287809"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.426387"], ["updated_at", "2019-06-24 11:03:29.426387"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1265], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-24 11:03:29.441437"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1265]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["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-06-24 11:03:29.447321"], ["updated_at", "2019-06-24 11:03:29.447321"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.454886"], ["updated_at", "2019-06-24 11:03:29.454886"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.459219"], ["updated_at", "2019-06-24 11:03:29.459219"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.466948"], ["updated_at", "2019-06-24 11:03:29.466948"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.472109"], ["updated_at", "2019-06-24 11:03:29.472109"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.475093"], ["updated_at", "2019-06-24 11:03:29.475093"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.478841"], ["updated_at", "2019-06-24 11:03:29.478841"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.483141"], ["updated_at", "2019-06-24 11:03:29.483141"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.485123"], ["updated_at", "2019-06-24 11:03:29.485123"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.490734"], ["updated_at", "2019-06-24 11:03:29.490734"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.493089"], ["updated_at", "2019-06-24 11:03:29.493089"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:03:29.497007"], ["updated_at", "2019-06-24 11:03:29.497007"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:03:29.501917"], ["updated_at", "2019-06-24 11:03:29.501917"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.503886"], ["updated_at", "2019-06-24 11:03:29.503886"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:03:29.507817"], ["updated_at", "2019-06-24 11:03:29.507817"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.510532"], ["updated_at", "2019-06-24 11:03:29.510532"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:03:29.514437"], ["updated_at", "2019-06-24 11:03:29.514437"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.517173"], ["updated_at", "2019-06-24 11:03:29.517173"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.520272"], ["updated_at", "2019-06-24 11:03:29.520272"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.522118"], ["updated_at", "2019-06-24 11:03:29.522118"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:03:29.524544"], ["updated_at", "2019-06-24 11:03:29.524544"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.531090"], ["updated_at", "2019-06-24 11:03:29.531090"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.533730"], ["updated_at", "2019-06-24 11:03:29.533730"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:03:29.536221"], ["updated_at", "2019-06-24 11:03:29.536221"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1284], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.540447"], ["updated_at", "2019-06-24 11:03:29.540447"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.543047"], ["updated_at", "2019-06-24 11:03:29.543047"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:03:29.545941"], ["updated_at", "2019-06-24 11:03:29.545941"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (1.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", 1287], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.556240"], ["updated_at", "2019-06-24 11:03:29.556240"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.561570"], ["updated_at", "2019-06-24 11:03:29.561570"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:03:29.567069"], ["updated_at", "2019-06-24 11:03:29.567069"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1291], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1291], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 11:03:29.572092"], ["id", 1291]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1291], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:03:29.607205"], ["updated_at", "2019-06-24 11:03:29.607205"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:03:29.613508"], ["updated_at", "2019-06-24 11:03:29.613508"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:03:29.622023"], ["updated_at", "2019-06-24 11:03:29.622023"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:03:29.635904"], ["updated_at", "2019-06-24 11:03:29.635904"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 8.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) 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-06-24 11:03:29.658938"], ["updated_at", "2019-06-24 11:03:29.658938"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.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 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.1ms) ROLLBACK  (0.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 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:03:29.686467"], ["updated_at", "2019-06-24 11:03:29.686467"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["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-06-24 11:03:29.692464"], ["updated_at", "2019-06-24 11:03:29.692464"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:03:29.696776"], ["updated_at", "2019-06-24 11:03:29.696776"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) 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"."customized_key" = $2 LIMIT $3 [["host", "test.host"], ["customized_key", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.705397"], ["updated_at", "2019-06-24 11:03:29.705397"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) 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.3ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.715482"], ["updated_at", "2019-06-24 11:03:29.715482"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.722673"], ["updated_at", "2019-06-24 11:03:29.722673"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.738459"], ["updated_at", "2019-06-24 11:03:29.738459"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.753028"], ["updated_at", "2019-06-24 11:03:29.753028"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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 (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:03:29.768850"], ["updated_at", "2019-06-24 11:03:29.768850"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.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-06-24 11:04:22.565412"], ["updated_at", "2019-06-24 11:04:22.565412"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:22.595613"], ["updated_at", "2019-06-24 11:04:22.595613"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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-06-24 11:04:22.608888"], ["updated_at", "2019-06-24 11:04:22.608888"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:22.612404"], ["updated_at", "2019-06-24 11:04:22.612404"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.620394"], ["updated_at", "2019-06-24 11:04:22.620394"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.622489"], ["updated_at", "2019-06-24 11:04:22.622489"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.627896"], ["updated_at", "2019-06-24 11:04:22.627896"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.629684"], ["updated_at", "2019-06-24 11:04:22.629684"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:04:22.647667"], ["updated_at", "2019-06-24 11:04:22.647667"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:04:22.652853"], ["updated_at", "2019-06-24 11:04:22.652853"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.655354"], ["updated_at", "2019-06-24 11:04:22.655354"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:04:22.660065"], ["updated_at", "2019-06-24 11:04:22.660065"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.661974"], ["updated_at", "2019-06-24 11:04:22.661974"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:04:22.665365"], ["updated_at", "2019-06-24 11:04:22.665365"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"], ["customized_key", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.668064"], ["updated_at", "2019-06-24 11:04:22.668064"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.672753"], ["updated_at", "2019-06-24 11:04:22.672753"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.674698"], ["updated_at", "2019-06-24 11:04:22.674698"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:04:22.678136"], ["updated_at", "2019-06-24 11:04:22.678136"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.682827"], ["updated_at", "2019-06-24 11:04:22.682827"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.685863"], ["updated_at", "2019-06-24 11:04:22.685863"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:04:22.688494"], ["updated_at", "2019-06-24 11:04:22.688494"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1311], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.693287"], ["updated_at", "2019-06-24 11:04:22.693287"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.695093"], ["updated_at", "2019-06-24 11:04:22.695093"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:04:22.697515"], ["updated_at", "2019-06-24 11:04:22.697515"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example.test"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1314], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.702365"], ["updated_at", "2019-06-24 11:04:22.702365"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1317], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1317], ["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-06-24 11:04:22.707990"], ["id", 1317]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1317], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:22.712675"], ["updated_at", "2019-06-24 11:04:22.712675"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:22.715560"], ["updated_at", "2019-06-24 11:04:22.715560"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:22.754411"], ["updated_at", "2019-06-24 11:04:22.754411"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:22.786736"], ["updated_at", "2019-06-24 11:04:22.786736"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.796069"], ["updated_at", "2019-06-24 11:04:22.796069"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:22.802681"], ["updated_at", "2019-06-24 11:04:22.802681"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:22.810822"], ["updated_at", "2019-06-24 11:04:22.810822"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:22.815180"], ["updated_at", "2019-06-24 11:04:22.815180"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.821682"], ["updated_at", "2019-06-24 11:04:22.821682"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561287862"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:22.826862"], ["updated_at", "2019-06-24 11:04:22.826862"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1323], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) 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-06-24 11:04:22.847951"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1323]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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-06-24 11:04:22.854228"], ["updated_at", "2019-06-24 11:04:22.854228"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561460662"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:22.860819"], ["updated_at", "2019-06-24 11:04:22.860819"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (1.0ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:22.894488"], ["updated_at", "2019-06-24 11:04:22.894488"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) 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 5ms (Views: 5.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:04:22.943821"], ["updated_at", "2019-06-24 11:04:22.943821"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:22.949631"], ["updated_at", "2019-06-24 11:04:22.949631"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:22.952445"], ["updated_at", "2019-06-24 11:04:22.952445"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."customized_key" = $2 LIMIT $3 [["host", "test.host"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:22.960268"], ["updated_at", "2019-06-24 11:04:22.960268"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:22.971969"], ["updated_at", "2019-06-24 11:04:22.971969"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:22.980562"], ["updated_at", "2019-06-24 11:04:22.980562"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) 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-06-24 11:04:22.991163"], ["updated_at", "2019-06-24 11:04:22.991163"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:23.006797"], ["updated_at", "2019-06-24 11:04:23.006797"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:04:23.014423"], ["updated_at", "2019-06-24 11:04:23.014423"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:04:23.037127"], ["updated_at", "2019-06-24 11:04:23.037127"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:04:23.042657"], ["updated_at", "2019-06-24 11:04:23.042657"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."customized_key" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["customized_key", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."customized_key" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["customized_key", 123], ["host", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-06-24 11:04:23.049239"], ["updated_at", "2019-06-24 11:04:23.049239"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:04:23.057803"], ["updated_at", "2019-06-24 11:04:23.057803"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:04:23.073816"], ["updated_at", "2019-06-24 11:04:23.073816"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:04:23.079383"], ["updated_at", "2019-06-24 11:04:23.079383"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:04:23.082223"], ["updated_at", "2019-06-24 11:04:23.082223"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-24 11:04:23.089304"], ["updated_at", "2019-06-24 11:04:23.089304"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-24 11:04:23.090911"], ["synced_id", 0], ["id", 1179]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 11:04:23.098606"], ["updated_at", "2019-06-24 11:04:23.098606"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1180], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1180], ["LIMIT", 1]] Account Update (0.2ms) 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-06-24 11:04:23.102676"], ["id", 1180]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1180], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:04:23.106855"], ["updated_at", "2019-06-24 11:04:23.106855"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:04:23.127564"], ["updated_at", "2019-06-24 11:04:23.127564"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 11:04:23.132362"], ["updated_at", "2019-06-24 11:04:23.132362"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:23.135757"], ["updated_at", "2019-06-24 11:04:23.135757"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:23.140408"], ["updated_at", "2019-06-24 11:04:23.140408"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:23.145813"], ["updated_at", "2019-06-24 11:04:23.145813"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:23.150861"], ["updated_at", "2019-06-24 11:04:23.150861"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:23.156237"], ["updated_at", "2019-06-24 11:04:23.156237"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:04:23.159886"], ["updated_at", "2019-06-24 11:04:23.159886"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:23.163371"], ["updated_at", "2019-06-24 11:04:23.163371"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:04:23.165757"], ["updated_at", "2019-06-24 11:04:23.165757"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:23.169822"], ["updated_at", "2019-06-24 11:04:23.169822"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:04:23.172603"], ["updated_at", "2019-06-24 11:04:23.172603"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:04:23.176129"], ["updated_at", "2019-06-24 11:04:23.176129"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."customized_key" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["customized_key", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" = $1 LIMIT $2 [["customized_key", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "customized_key") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-06-24 11:04:23.178676"], ["updated_at", "2019-06-24 11:04:23.178676"], ["provider", "bookingsync"], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["customized_key", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 11:04:23.181828"], ["updated_at", "2019-06-24 11:04:23.181828"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561287863"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1196], ["LIMIT", 1]] Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-24 11:04:23.197680"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1196]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."customized_key" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 11:04:23.202210"], ["updated_at", "2019-06-24 11:04:23.202210"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561460663"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (3.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Create (3.0ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-06-24 11:05:03.976573"], ["updated_at", "2019-06-24 11:05:03.976573"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (5.6ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-06-24 11:05:03.981141"], ["synced_id", 0], ["id", 1198]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:05:04.002241"], ["updated_at", "2019-06-24 11:05:04.002241"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:05:04.006106"], ["updated_at", "2019-06-24 11:05:04.006106"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:05:04.028627"], ["updated_at", "2019-06-24 11:05:04.028627"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:05:04.032091"], ["updated_at", "2019-06-24 11:05:04.032091"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:05:04.034145"], ["updated_at", "2019-06-24 11:05:04.034145"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:05:04.052537"], ["updated_at", "2019-06-24 11:05:04.052537"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.055556"], ["updated_at", "2019-06-24 11:05:04.055556"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.057978"], ["updated_at", "2019-06-24 11:05:04.057978"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1206], ["LIMIT", 1]] Account Update (0.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-06-24 11:05:04.062335"], ["id", 1206]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.066445"], ["updated_at", "2019-06-24 11:05:04.066445"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.068261"], ["updated_at", "2019-06-24 11:05:04.068261"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1208], ["LIMIT", 1]] Account Update (0.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-06-24 11:05:04.070596"], ["id", 1208]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.075139"], ["updated_at", "2019-06-24 11:05:04.075139"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.078926"], ["updated_at", "2019-06-24 11:05:04.078926"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1210], ["LIMIT", 1]] Account Update (0.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-06-24 11:05:04.083840"], ["id", 1210]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1210], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.089955"], ["updated_at", "2019-06-24 11:05:04.089955"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.095268"], ["updated_at", "2019-06-24 11:05:04.095268"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1212], ["LIMIT", 1]] Account Update (0.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-06-24 11:05:04.100446"], ["id", 1212]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1212], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.107992"], ["updated_at", "2019-06-24 11:05:04.107992"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:05:04.119978"], ["updated_at", "2019-06-24 11:05:04.119978"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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-06-24 11:05:04.124609"], ["updated_at", "2019-06-24 11:05:04.124609"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:05:04.130156"], ["updated_at", "2019-06-24 11:05:04.130156"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.134442"], ["updated_at", "2019-06-24 11:05:04.134442"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:05:04.139458"], ["updated_at", "2019-06-24 11:05:04.139458"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.144930"], ["updated_at", "2019-06-24 11:05:04.144930"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:05:04.149887"], ["updated_at", "2019-06-24 11:05:04.149887"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 11:05:04.155363"], ["updated_at", "2019-06-24 11:05:04.155363"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1221], ["LIMIT", 1]]  (0.1ms) 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", 1221], ["LIMIT", 1]] Account Update (0.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-06-24 11:05:04.165575"], ["id", 1221]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1221], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:05:04.174263"], ["updated_at", "2019-06-24 11:05:04.174263"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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-06-24 11:05:04.178340"], ["updated_at", "2019-06-24 11:05:04.178340"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:05:04.181184"], ["updated_at", "2019-06-24 11:05:04.181184"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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-06-24 11:05:04.187338"], ["updated_at", "2019-06-24 11:05:04.187338"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) 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.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-06-24 11:05:04.196181"], ["updated_at", "2019-06-24 11:05:04.196181"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561287904"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1226], ["LIMIT", 1]] Account Update (3.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-06-24 11:05:04.216282"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1226]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:05:04.225880"], ["updated_at", "2019-06-24 11:05:04.225880"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561460704"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) 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-06-24 11:05:04.252375"], ["updated_at", "2019-06-24 11:05:04.252375"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.270064"], ["updated_at", "2019-06-24 11:05:04.270064"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.285020"], ["updated_at", "2019-06-24 11:05:04.285020"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.294352"], ["updated_at", "2019-06-24 11:05:04.294352"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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-06-24 11:05:04.308721"], ["updated_at", "2019-06-24 11:05:04.308721"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.317633"], ["updated_at", "2019-06-24 11:05:04.317633"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.325532"], ["updated_at", "2019-06-24 11:05:04.325532"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.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-06-24 11:05:04.352665"], ["updated_at", "2019-06-24 11:05:04.352665"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:05:04.356821"], ["updated_at", "2019-06-24 11:05:04.356821"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) 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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.367509"], ["updated_at", "2019-06-24 11:05:04.367509"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.369670"], ["updated_at", "2019-06-24 11:05:04.369670"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.371757"], ["updated_at", "2019-06-24 11:05:04.371757"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.373860"], ["updated_at", "2019-06-24 11:05:04.373860"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.379556"], ["updated_at", "2019-06-24 11:05:04.379556"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.383060"], ["updated_at", "2019-06-24 11:05:04.383060"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.385680"], ["updated_at", "2019-06-24 11:05:04.385680"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.389248"], ["updated_at", "2019-06-24 11:05:04.389248"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.391851"], ["updated_at", "2019-06-24 11:05:04.391851"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.396527"], ["updated_at", "2019-06-24 11:05:04.396527"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.401241"], ["updated_at", "2019-06-24 11:05:04.401241"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.403064"], ["updated_at", "2019-06-24 11:05:04.403064"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.407426"], ["updated_at", "2019-06-24 11:05:04.407426"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:05:04.410757"], ["updated_at", "2019-06-24 11:05:04.410757"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example3.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:05:04.415599"], ["updated_at", "2019-06-24 11:05:04.415599"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.418016"], ["updated_at", "2019-06-24 11:05:04.418016"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:05:04.421461"], ["updated_at", "2019-06-24 11:05:04.421461"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.424057"], ["updated_at", "2019-06-24 11:05:04.424057"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1344], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 11:05:04.428948"], ["id", 1344]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:05:04.433152"], ["updated_at", "2019-06-24 11:05:04.433152"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.435156"], ["updated_at", "2019-06-24 11:05:04.435156"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1346], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 11:05:04.437801"], ["id", 1346]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1346], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:05:04.442289"], ["updated_at", "2019-06-24 11:05:04.442289"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:05:04.445291"], ["updated_at", "2019-06-24 11:05:04.445291"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "example.test"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) 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", 1348], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 11:05:04.448286"], ["id", 1348]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1348], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.452324"], ["updated_at", "2019-06-24 11:05:04.452324"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.454187"], ["updated_at", "2019-06-24 11:05:04.454187"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.460185"], ["updated_at", "2019-06-24 11:05:04.460185"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.463389"], ["updated_at", "2019-06-24 11:05:04.463389"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.482103"], ["updated_at", "2019-06-24 11:05:04.482103"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.484961"], ["updated_at", "2019-06-24 11:05:04.484961"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.488558"], ["updated_at", "2019-06-24 11:05:04.488558"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1354], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1354], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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-06-24 11:05:04.492730"], ["id", 1354]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1354], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.498935"], ["updated_at", "2019-06-24 11:05:04.498935"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.503244"], ["updated_at", "2019-06-24 11:05:04.503244"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561460704"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.506132"], ["updated_at", "2019-06-24 11:05:04.506132"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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-06-24 11:05:04.511807"], ["updated_at", "2019-06-24 11:05:04.511807"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1561287904"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-06-24 11:05:04.515096"], ["updated_at", "2019-06-24 11:05:04.515096"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1356], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) 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-06-24 11:05:04.532425"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1356]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.535925"], ["updated_at", "2019-06-24 11:05:04.535925"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.537807"], ["updated_at", "2019-06-24 11:05:04.537807"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.539776"], ["updated_at", "2019-06-24 11:05:04.539776"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.543510"], ["updated_at", "2019-06-24 11:05:04.543510"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.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.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.5ms | ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.4ms) 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.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:05:04.609483"], ["updated_at", "2019-06-24 11:05:04.609483"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.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.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:05:04.621893"], ["updated_at", "2019-06-24 11:05:04.621893"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 2.1ms)  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) 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.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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-06-24 11:05:04.631397"], ["updated_at", "2019-06-24 11:05:04.631397"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."provider" = $2 AND "multi_applications_accounts"."synced_id" = $3 LIMIT $4 [["host", "test.host"], ["provider", "bookingsync"], ["synced_id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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-06-24 11:05:04.639801"], ["updated_at", "2019-06-24 11:05:04.639801"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 4ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application Rendered /Users/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.0ms) Completed 200 OK in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-06-24 11:05:04.657346"], ["updated_at", "2019-06-24 11:05:04.657346"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.663383"], ["updated_at", "2019-06-24 11:05:04.663383"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-06-24 11:05:04.665932"], ["updated_at", "2019-06-24 11:05:04.665932"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) 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.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:17:31.250700"], ["updated_at", "2020-03-25 16:17:31.250700"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:17:31.262546"], ["updated_at", "2020-03-25 16:17:31.262546"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) 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", "2020-03-25 16:17:31.317323"], ["updated_at", "2020-03-25 16:17:31.317323"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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", "2020-03-25 16:17:31.321600"], ["updated_at", "2020-03-25 16:17:31.321600"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:17:31.329921"], ["updated_at", "2020-03-25 16:17:31.329921"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:17:31.332510"], ["updated_at", "2020-03-25 16:17:31.332510"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:17:31.336280"], ["updated_at", "2020-03-25 16:17:31.336280"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:17:31.338898"], ["updated_at", "2020-03-25 16:17:31.338898"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:17:31.344484"], ["updated_at", "2020-03-25 16:17:31.344484"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:17:31.346195"], ["updated_at", "2020-03-25 16:17:31.346195"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 10], ["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", "2020-03-25 16:17:31.349036"], ["id", 10]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 10], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:17:31.355450"], ["updated_at", "2020-03-25 16:17:31.355450"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:17:31.357339"], ["updated_at", "2020-03-25 16:17:31.357339"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 12], ["LIMIT", 1]] Account Update (0.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", "2020-03-25 16:17:31.359959"], ["id", 12]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 12], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.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", "2020-03-25 16:17:31.365331"], ["updated_at", "2020-03-25 16:17:31.365331"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:17:31.368925"], ["updated_at", "2020-03-25 16:17:31.368925"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 14], ["LIMIT", 1]] Account Update (0.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", "2020-03-25 16:17:31.371466"], ["id", 14]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:17:31.374631"], ["updated_at", "2020-03-25 16:17:31.374631"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:17:31.376386"], ["updated_at", "2020-03-25 16:17:31.376386"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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 (0.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", "2020-03-25 16:17:31.378774"], ["id", 16]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:17:31.382113"], ["updated_at", "2020-03-25 16:17:31.382113"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:17:31.391487"], ["updated_at", "2020-03-25 16:17:31.391487"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:17:31.405818"], ["updated_at", "2020-03-25 16:17:31.405818"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1585066651"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:17:31.420007"], ["updated_at", "2020-03-25 16:17:31.420007"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1585239451"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-03-25 16:17:31.424582"], ["updated_at", "2020-03-25 16:17:31.424582"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-03-25 16:17:31.425927"], ["synced_id", 0], ["id", 21]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:17:31.442029"], ["updated_at", "2020-03-25 16:17:31.442029"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:17:31.492566"], ["updated_at", "2020-03-25 16:17:31.492566"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:17:31.495660"], ["updated_at", "2020-03-25 16:17:31.495660"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 24], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 24], ["LIMIT", 1]] Account Update (0.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", "2020-03-25 16:17:31.498415"], ["id", 24]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 24], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:17:31.556245"], ["updated_at", "2020-03-25 16:17:31.556245"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:17:31.558089"], ["updated_at", "2020-03-25 16:17:31.558089"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:17:31.559853"], ["updated_at", "2020-03-25 16:17:31.559853"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.6ms) BEGIN  (0.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", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2020-03-25 16:21:36.637281"], ["updated_at", "2020-03-25 16:21:36.637281"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1585239696"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:21:36.697195"], ["updated_at", "2020-03-25 16:21:36.697195"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1585066896"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:24:08.523559"], ["updated_at", "2020-03-25 16:24:08.523559"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.5ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:24:08.621384"], ["updated_at", "2020-03-25 16:24:08.621384"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:24:08.630108"], ["updated_at", "2020-03-25 16:24:08.630108"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:24:08.669365"], ["updated_at", "2020-03-25 16:24:08.669365"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:24:08.672062"], ["updated_at", "2020-03-25 16:24:08.672062"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) 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 (0.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", "2020-03-25 16:24:08.680860"], ["id", 34]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:24:08.688305"], ["updated_at", "2020-03-25 16:24:08.688305"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:24:08.693173"], ["updated_at", "2020-03-25 16:24:08.693173"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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 (0.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", "2020-03-25 16:24:08.698060"], ["id", 36]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:24:08.701953"], ["updated_at", "2020-03-25 16:24:08.701953"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:24:08.704121"], ["updated_at", "2020-03-25 16:24:08.704121"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) 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.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 (0.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", "2020-03-25 16:24:08.712648"], ["id", 38]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 38], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:24:08.719576"], ["updated_at", "2020-03-25 16:24:08.719576"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:24:08.721771"], ["updated_at", "2020-03-25 16:24:08.721771"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) 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.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 40], ["LIMIT", 1]] Account Update (0.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", "2020-03-25 16:24:08.726855"], ["id", 40]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 40], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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", "2020-03-25 16:24:08.733246"], ["updated_at", "2020-03-25 16:24:08.733246"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-03-25 16:24:08.738227"], ["updated_at", "2020-03-25 16:24:08.738227"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:24:08.751107"], ["updated_at", "2020-03-25 16:24:08.751107"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:24:08.754531"], ["updated_at", "2020-03-25 16:24:08.754531"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-03-25 16:24:08.762025"], ["updated_at", "2020-03-25 16:24:08.762025"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:24:08.766323"], ["updated_at", "2020-03-25 16:24:08.766323"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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", "2020-03-25 16:24:08.770947"], ["updated_at", "2020-03-25 16:24:08.770947"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:24:08.778199"], ["updated_at", "2020-03-25 16:24:08.778199"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.8ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-03-25 16:24:08.783546"], ["updated_at", "2020-03-25 16:24:08.783546"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-03-25 16:24:08.785713"], ["synced_id", 0], ["id", 49]]  (0.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]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:24:08.820856"], ["updated_at", "2020-03-25 16:24:08.820856"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:24:08.823626"], ["updated_at", "2020-03-25 16:24:08.823626"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:24:08.827893"], ["updated_at", "2020-03-25 16:24:08.827893"], ["synced_id", 3]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-03-25 16:24:08.835595"], ["updated_at", "2020-03-25 16:24:08.835595"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 53], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 53], ["LIMIT", 1]] Account Update (0.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", "2020-03-25 16:24:08.839340"], ["id", 53]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 53], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-03-25 16:24:08.850405"], ["updated_at", "2020-03-25 16:24:08.850405"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (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", "2020-03-25 16:24:26.228535"], ["updated_at", "2020-03-25 16:24:26.228535"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1585067066"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (2.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", "2020-03-25 16:51:50.396763"], ["updated_at", "2020-03-25 16:51:50.396763"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1585068710"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 56], ["LIMIT", 1]] Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-03-25 16:51:50.440000"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 56]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.9ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (12.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (22.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:56.832580"], ["updated_at", "2020-12-22 11:53:56.832580"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:57.681670"], ["updated_at", "2020-12-22 11:53:57.681670"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:57.689109"], ["updated_at", "2020-12-22 11:53:57.689109"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:57.697015"], ["updated_at", "2020-12-22 11:53:57.697015"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:57.710864"], ["updated_at", "2020-12-22 11:53:57.710864"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:57.720793"], ["updated_at", "2020-12-22 11:53:57.720793"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (13.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 11:53:57.832381"], ["updated_at", "2020-12-22 11:53:57.832381"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 38ms (ActiveRecord: 23.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:57.850767"], ["updated_at", "2020-12-22 11:53:57.850767"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (6.8ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:57.872960"], ["updated_at", "2020-12-22 11:53:57.872960"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (9.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (4.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", "2020-12-22 11:53:57.907962"], ["updated_at", "2020-12-22 11:53:57.907962"], ["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.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 25ms (ActiveRecord: 6.0ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 25ms (Views: 20.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (2.4ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 6ms (Views: 5.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:53:58.025577"], ["updated_at", "2020-12-22 11:53:58.025577"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:53:58.034623"], ["updated_at", "2020-12-22 11:53:58.034623"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.042885"], ["updated_at", "2020-12-22 11:53:58.042885"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608551638"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 62], ["LIMIT", 1]] SQL (1.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 11:53:58.088000"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 62]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.110717"], ["updated_at", "2020-12-22 11:53:58.110717"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608724438"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:53:58.114560"], ["updated_at", "2020-12-22 11:53:58.114560"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:53:58.132679"], ["updated_at", "2020-12-22 11:53:58.132679"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:53:58.134416"], ["updated_at", "2020-12-22 11:53:58.134416"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:53:58.136035"], ["updated_at", "2020-12-22 11:53:58.136035"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.143789"], ["updated_at", "2020-12-22 11:53:58.143789"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 11:53:58.157026"], ["updated_at", "2020-12-22 11:53:58.157026"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 11:53:58.158498"], ["synced_id", 0], ["id", 69]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (2.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.168872"], ["updated_at", "2020-12-22 11:53:58.168872"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.171115"], ["updated_at", "2020-12-22 11:53:58.171115"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 71], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.173921"], ["id", 71]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.177628"], ["updated_at", "2020-12-22 11:53:58.177628"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.179460"], ["updated_at", "2020-12-22 11:53:58.179460"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 73], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.182865"], ["id", 73]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 73], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.186742"], ["updated_at", "2020-12-22 11:53:58.186742"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.189427"], ["updated_at", "2020-12-22 11:53:58.189427"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 75], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.192209"], ["id", 75]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 75], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.196300"], ["updated_at", "2020-12-22 11:53:58.196300"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.199538"], ["updated_at", "2020-12-22 11:53:58.199538"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 77], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.203358"], ["id", 77]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.206895"], ["updated_at", "2020-12-22 11:53:58.206895"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.210814"], ["updated_at", "2020-12-22 11:53:58.210814"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.215877"], ["updated_at", "2020-12-22 11:53:58.215877"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.218512"], ["updated_at", "2020-12-22 11:53:58.218512"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.222221"], ["updated_at", "2020-12-22 11:53:58.222221"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.225251"], ["updated_at", "2020-12-22 11:53:58.225251"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.228608"], ["updated_at", "2020-12-22 11:53:58.228608"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.231448"], ["updated_at", "2020-12-22 11:53:58.231448"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.284346"], ["updated_at", "2020-12-22 11:53:58.284346"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 86], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 86], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 11:53:58.287172"], ["id", 86]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 86], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.291956"], ["updated_at", "2020-12-22 11:53:58.291956"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) 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 (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.306260"], ["updated_at", "2020-12-22 11:53:58.306260"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.308385"], ["updated_at", "2020-12-22 11:53:58.308385"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.317054"], ["updated_at", "2020-12-22 11:53:58.317054"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.319078"], ["updated_at", "2020-12-22 11:53:58.319078"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 5], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.321868"], ["id", 5]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.325546"], ["updated_at", "2020-12-22 11:53:58.325546"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.327731"], ["updated_at", "2020-12-22 11:53:58.327731"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 7], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.331311"], ["id", 7]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 7], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.336013"], ["updated_at", "2020-12-22 11:53:58.336013"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.338224"], ["updated_at", "2020-12-22 11:53:58.338224"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 9], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.341231"], ["id", 9]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 9], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.345223"], ["updated_at", "2020-12-22 11:53:58.345223"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.347459"], ["updated_at", "2020-12-22 11:53:58.347459"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:53:58.351457"], ["updated_at", "2020-12-22 11:53:58.351457"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:53:58.355882"], ["updated_at", "2020-12-22 11:53:58.355882"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.358073"], ["updated_at", "2020-12-22 11:53:58.358073"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:53:58.362338"], ["updated_at", "2020-12-22 11:53:58.362338"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 11:53:58.365204"], ["updated_at", "2020-12-22 11:53:58.365204"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:53:58.371183"], ["updated_at", "2020-12-22 11:53:58.371183"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.374014"], ["updated_at", "2020-12-22 11:53:58.374014"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.377689"], ["updated_at", "2020-12-22 11:53:58.377689"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.381699"], ["updated_at", "2020-12-22 11:53:58.381699"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:53:58.386540"], ["updated_at", "2020-12-22 11:53:58.386540"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608551638"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.389839"], ["updated_at", "2020-12-22 11:53:58.389839"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 21], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 11:53:58.406807"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 21]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:53:58.410520"], ["updated_at", "2020-12-22 11:53:58.410520"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608724438"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.413664"], ["updated_at", "2020-12-22 11:53:58.413664"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:53:58.418423"], ["updated_at", "2020-12-22 11:53:58.418423"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 23], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 23], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:53:58.421557"], ["id", 23]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 23], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.426651"], ["updated_at", "2020-12-22 11:53:58.426651"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:53:58.431657"], ["updated_at", "2020-12-22 11:53:58.431657"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.435808"], ["updated_at", "2020-12-22 11:53:58.435808"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.437788"], ["updated_at", "2020-12-22 11:53:58.437788"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.439847"], ["updated_at", "2020-12-22 11:53:58.439847"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.441766"], ["updated_at", "2020-12-22 11:53:58.441766"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.445987"], ["updated_at", "2020-12-22 11:53:58.445987"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.451174"], ["updated_at", "2020-12-22 11:53:58.451174"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.455382"], ["updated_at", "2020-12-22 11:53:58.455382"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.461021"], ["updated_at", "2020-12-22 11:53:58.461021"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.466513"], ["updated_at", "2020-12-22 11:53:58.466513"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:53:58.488651"], ["updated_at", "2020-12-22 11:53:58.488651"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.494102"], ["updated_at", "2020-12-22 11:53:58.494102"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:53:58.496194"], ["updated_at", "2020-12-22 11:53:58.496194"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:53:58.543900"], ["updated_at", "2020-12-22 11:53:58.543900"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 12ms (Views: 11.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.1ms) ROLLBACK  (0.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 5ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (22.4ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:10.732600"], ["updated_at", "2020-12-22 11:58:10.732600"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:10.783965"], ["updated_at", "2020-12-22 11:58:10.783965"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:10.789449"], ["updated_at", "2020-12-22 11:58:10.789449"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.839934"], ["updated_at", "2020-12-22 11:58:10.839934"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 90], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 90], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 11:58:10.853051"], ["id", 90]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 90], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.856817"], ["updated_at", "2020-12-22 11:58:10.856817"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.860261"], ["updated_at", "2020-12-22 11:58:10.860261"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.862454"], ["updated_at", "2020-12-22 11:58:10.862454"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 93], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.865277"], ["id", 93]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 93], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.871532"], ["updated_at", "2020-12-22 11:58:10.871532"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.873256"], ["updated_at", "2020-12-22 11:58:10.873256"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 95], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.875734"], ["id", 95]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 95], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.879490"], ["updated_at", "2020-12-22 11:58:10.879490"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.881569"], ["updated_at", "2020-12-22 11:58:10.881569"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 97], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.883987"], ["id", 97]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.887934"], ["updated_at", "2020-12-22 11:58:10.887934"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.889606"], ["updated_at", "2020-12-22 11:58:10.889606"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 99], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.891911"], ["id", 99]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.895205"], ["updated_at", "2020-12-22 11:58:10.895205"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.899985"], ["updated_at", "2020-12-22 11:58:10.899985"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.904072"], ["updated_at", "2020-12-22 11:58:10.904072"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.906441"], ["updated_at", "2020-12-22 11:58:10.906441"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.909640"], ["updated_at", "2020-12-22 11:58:10.909640"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.912274"], ["updated_at", "2020-12-22 11:58:10.912274"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:10.915151"], ["updated_at", "2020-12-22 11:58:10.915151"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.920888"], ["updated_at", "2020-12-22 11:58:10.920888"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.933032"], ["updated_at", "2020-12-22 11:58:10.933032"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608551890"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 108], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 11:58:10.954850"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 108]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:10.960624"], ["updated_at", "2020-12-22 11:58:10.960624"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608724690"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:10.966045"], ["updated_at", "2020-12-22 11:58:10.966045"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:10.971259"], ["updated_at", "2020-12-22 11:58:10.971259"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:10.973908"], ["updated_at", "2020-12-22 11:58:10.973908"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:10.978560"], ["updated_at", "2020-12-22 11:58:10.978560"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.9ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 11:58:10.989712"], ["updated_at", "2020-12-22 11:58:10.989712"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 11:58:10.991645"], ["synced_id", 0], ["id", 114]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (1.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:11.050080"], ["updated_at", "2020-12-22 11:58:11.050080"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (10.1ms) SELECT 1 AS one 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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:11.094655"], ["updated_at", "2020-12-22 11:58:11.094655"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:11.097315"], ["updated_at", "2020-12-22 11:58:11.097315"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:11.118433"], ["updated_at", "2020-12-22 11:58:11.118433"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:11.123725"], ["updated_at", "2020-12-22 11:58:11.123725"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.7ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:11.129981"], ["updated_at", "2020-12-22 11:58:11.129981"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:11.137858"], ["updated_at", "2020-12-22 11:58:11.137858"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 3.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:11.161615"], ["updated_at", "2020-12-22 11:58:11.161615"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.164584"], ["updated_at", "2020-12-22 11:58:11.164584"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.167452"], ["updated_at", "2020-12-22 11:58:11.167452"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.173381"], ["updated_at", "2020-12-22 11:58:11.173381"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:11.178457"], ["updated_at", "2020-12-22 11:58:11.178457"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:11.182556"], ["updated_at", "2020-12-22 11:58:11.182556"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:11.186005"], ["updated_at", "2020-12-22 11:58:11.186005"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:11.188654"], ["updated_at", "2020-12-22 11:58:11.188654"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:11.190921"], ["updated_at", "2020-12-22 11:58:11.190921"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.195339"], ["updated_at", "2020-12-22 11:58:11.195339"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:11.204808"], ["updated_at", "2020-12-22 11:58:11.204808"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.207703"], ["updated_at", "2020-12-22 11:58:11.207703"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:11.211950"], ["updated_at", "2020-12-22 11:58:11.211950"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608724691"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.214953"], ["updated_at", "2020-12-22 11:58:11.214953"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:11.220045"], ["updated_at", "2020-12-22 11:58:11.220045"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608551891"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.223631"], ["updated_at", "2020-12-22 11:58:11.223631"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 45], ["host", "example.test"], ["LIMIT", 1]] SQL (0.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 11:58:11.241297"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 45]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.244880"], ["updated_at", "2020-12-22 11:58:11.244880"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.246794"], ["updated_at", "2020-12-22 11:58:11.246794"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:11.250304"], ["updated_at", "2020-12-22 11:58:11.250304"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:11.255846"], ["updated_at", "2020-12-22 11:58:11.255846"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 11:58:11.258842"], ["updated_at", "2020-12-22 11:58:11.258842"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) 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.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:11.270234"], ["updated_at", "2020-12-22 11:58:11.270234"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.272856"], ["updated_at", "2020-12-22 11:58:11.272856"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:11.277020"], ["updated_at", "2020-12-22 11:58:11.277020"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.279027"], ["updated_at", "2020-12-22 11:58:11.279027"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.282121"], ["updated_at", "2020-12-22 11:58:11.282121"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.284167"], ["updated_at", "2020-12-22 11:58:11.284167"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 55], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:11.287938"], ["id", 55]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.292024"], ["updated_at", "2020-12-22 11:58:11.292024"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 11:58:11.294242"], ["updated_at", "2020-12-22 11:58:11.294242"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 57], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:11.297995"], ["id", 57]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 57], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.303070"], ["updated_at", "2020-12-22 11:58:11.303070"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.305085"], ["updated_at", "2020-12-22 11:58:11.305085"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 59], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:11.307684"], ["id", 59]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 59], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.312491"], ["updated_at", "2020-12-22 11:58:11.312491"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.314536"], ["updated_at", "2020-12-22 11:58:11.314536"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:11.318264"], ["updated_at", "2020-12-22 11:58:11.318264"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 63], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 63], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:11.321647"], ["id", 63]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 63], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:11.325743"], ["updated_at", "2020-12-22 11:58:11.325743"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.328949"], ["updated_at", "2020-12-22 11:58:11.328949"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.347986"], ["updated_at", "2020-12-22 11:58:11.347986"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.356446"], ["updated_at", "2020-12-22 11:58:11.356446"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.8ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.369665"], ["updated_at", "2020-12-22 11:58:11.369665"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.378550"], ["updated_at", "2020-12-22 11:58:11.378550"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.386760"], ["updated_at", "2020-12-22 11:58:11.386760"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:11.398083"], ["updated_at", "2020-12-22 11:58:11.398083"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.host"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.116241"], ["updated_at", "2020-12-22 11:58:24.116241"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.118937"], ["updated_at", "2020-12-22 11:58:24.118937"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:24.418597"], ["updated_at", "2020-12-22 11:58:24.418597"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.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 7ms (Views: 6.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 5ms (Views: 4.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 2ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.505107"], ["updated_at", "2020-12-22 11:58:24.505107"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 21ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.528024"], ["updated_at", "2020-12-22 11:58:24.528024"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:24.537491"], ["updated_at", "2020-12-22 11:58:24.537491"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.546406"], ["updated_at", "2020-12-22 11:58:24.546406"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 4ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.563230"], ["updated_at", "2020-12-22 11:58:24.563230"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.576475"], ["updated_at", "2020-12-22 11:58:24.576475"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.582902"], ["updated_at", "2020-12-22 11:58:24.582902"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.584854"], ["updated_at", "2020-12-22 11:58:24.584854"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.590379"], ["updated_at", "2020-12-22 11:58:24.590379"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.592670"], ["updated_at", "2020-12-22 11:58:24.592670"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:24.596436"], ["updated_at", "2020-12-22 11:58:24.596436"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:24.600531"], ["updated_at", "2020-12-22 11:58:24.600531"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.602486"], ["updated_at", "2020-12-22 11:58:24.602486"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:24.606642"], ["updated_at", "2020-12-22 11:58:24.606642"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 11:58:24.608814"], ["updated_at", "2020-12-22 11:58:24.608814"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:24.613386"], ["updated_at", "2020-12-22 11:58:24.613386"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.615304"], ["updated_at", "2020-12-22 11:58:24.615304"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.618595"], ["updated_at", "2020-12-22 11:58:24.618595"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.620508"], ["updated_at", "2020-12-22 11:58:24.620508"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 80], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.623755"], ["id", 80]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.628266"], ["updated_at", "2020-12-22 11:58:24.628266"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.630310"], ["updated_at", "2020-12-22 11:58:24.630310"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 82], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.632845"], ["id", 82]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 82], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.636729"], ["updated_at", "2020-12-22 11:58:24.636729"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.639007"], ["updated_at", "2020-12-22 11:58:24.639007"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 84], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 11:58:24.641920"], ["id", 84]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 84], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.647742"], ["updated_at", "2020-12-22 11:58:24.647742"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:24.677714"], ["updated_at", "2020-12-22 11:58:24.677714"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608551904"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.680649"], ["updated_at", "2020-12-22 11:58:24.680649"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 11:58:24.706983"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 86]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:24.711261"], ["updated_at", "2020-12-22 11:58:24.711261"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608724704"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.714270"], ["updated_at", "2020-12-22 11:58:24.714270"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.717959"], ["updated_at", "2020-12-22 11:58:24.717959"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.720895"], ["updated_at", "2020-12-22 11:58:24.720895"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.724567"], ["updated_at", "2020-12-22 11:58:24.724567"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:24.728783"], ["updated_at", "2020-12-22 11:58:24.728783"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.734940"], ["updated_at", "2020-12-22 11:58:24.734940"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.737820"], ["updated_at", "2020-12-22 11:58:24.737820"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (4.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.757692"], ["updated_at", "2020-12-22 11:58:24.757692"], ["synced_id", 1], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.765598"], ["updated_at", "2020-12-22 11:58:24.765598"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.768664"], ["updated_at", "2020-12-22 11:58:24.768664"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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", 2], ["host", "example2.test"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.772131"], ["updated_at", "2020-12-22 11:58:24.772131"], ["synced_id", 2], ["host", "example2.test"]]  (0.3ms) 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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.779396"], ["updated_at", "2020-12-22 11:58:24.779396"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 11:58:24.800231"], ["updated_at", "2020-12-22 11:58:24.800231"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 96], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 96], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.803325"], ["id", 96]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 96], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.814670"], ["updated_at", "2020-12-22 11:58:24.814670"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.819092"], ["updated_at", "2020-12-22 11:58:24.819092"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 123], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 123], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 11:58:24.821992"], ["id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:24.828667"], ["updated_at", "2020-12-22 11:58:24.828667"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:24.831656"], ["updated_at", "2020-12-22 11:58:24.831656"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 11:58:24.854711"], ["updated_at", "2020-12-22 11:58:24.854711"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 11:58:24.856147"], ["synced_id", 0], ["id", 126]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.862652"], ["updated_at", "2020-12-22 11:58:24.862652"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:24.866216"], ["updated_at", "2020-12-22 11:58:24.866216"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:24.868460"], ["updated_at", "2020-12-22 11:58:24.868460"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:24.870695"], ["updated_at", "2020-12-22 11:58:24.870695"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 11:58:24.874980"], ["updated_at", "2020-12-22 11:58:24.874980"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608551904"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 131], ["LIMIT", 1]] SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 11:58:24.892209"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 131]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.896527"], ["updated_at", "2020-12-22 11:58:24.896527"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608724704"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.900490"], ["updated_at", "2020-12-22 11:58:24.900490"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.904340"], ["updated_at", "2020-12-22 11:58:24.904340"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.910137"], ["updated_at", "2020-12-22 11:58:24.910137"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.913532"], ["updated_at", "2020-12-22 11:58:24.913532"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.917665"], ["updated_at", "2020-12-22 11:58:24.917665"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.920253"], ["updated_at", "2020-12-22 11:58:24.920253"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.923157"], ["updated_at", "2020-12-22 11:58:24.923157"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.926273"], ["updated_at", "2020-12-22 11:58:24.926273"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.930478"], ["updated_at", "2020-12-22 11:58:24.930478"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.932327"], ["updated_at", "2020-12-22 11:58:24.932327"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 142], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.934699"], ["id", 142]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 142], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.938427"], ["updated_at", "2020-12-22 11:58:24.938427"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.940390"], ["updated_at", "2020-12-22 11:58:24.940390"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 144], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.944183"], ["id", 144]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 144], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.947922"], ["updated_at", "2020-12-22 11:58:24.947922"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.949704"], ["updated_at", "2020-12-22 11:58:24.949704"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 146], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.952027"], ["id", 146]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.955319"], ["updated_at", "2020-12-22 11:58:24.955319"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:24.957037"], ["updated_at", "2020-12-22 11:58:24.957037"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 148], ["LIMIT", 1]] SQL (0.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", "2020-12-22 11:58:24.960506"], ["id", 148]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:24.963912"], ["updated_at", "2020-12-22 11:58:24.963912"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.968957"], ["updated_at", "2020-12-22 11:58:24.968957"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.978396"], ["updated_at", "2020-12-22 11:58:24.978396"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.985473"], ["updated_at", "2020-12-22 11:58:24.985473"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:24.997981"], ["updated_at", "2020-12-22 11:58:24.997981"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:25.010240"], ["updated_at", "2020-12-22 11:58:25.010240"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:25.021183"], ["updated_at", "2020-12-22 11:58:25.021183"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) 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", "2020-12-22 11:58:38.426147"], ["updated_at", "2020-12-22 11:58:38.426147"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:38.747231"], ["updated_at", "2020-12-22 11:58:38.747231"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:38.764924"], ["updated_at", "2020-12-22 11:58:38.764924"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:38.772588"], ["updated_at", "2020-12-22 11:58:38.772588"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.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 (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:38.783761"], ["updated_at", "2020-12-22 11:58:38.783761"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:38.797489"], ["updated_at", "2020-12-22 11:58:38.797489"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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 12ms (Views: 11.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.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 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (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", "2020-12-22 11:58:38.867829"], ["updated_at", "2020-12-22 11:58:38.867829"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:38.879300"], ["updated_at", "2020-12-22 11:58:38.879300"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:38.881412"], ["updated_at", "2020-12-22 11:58:38.881412"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:38.883579"], ["updated_at", "2020-12-22 11:58:38.883579"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:38.885535"], ["updated_at", "2020-12-22 11:58:38.885535"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:38.889444"], ["updated_at", "2020-12-22 11:58:38.889444"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:38.892237"], ["updated_at", "2020-12-22 11:58:38.892237"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:38.901987"], ["updated_at", "2020-12-22 11:58:38.901987"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) 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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:38.913330"], ["updated_at", "2020-12-22 11:58:38.913330"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:38.917249"], ["updated_at", "2020-12-22 11:58:38.917249"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:38.950698"], ["updated_at", "2020-12-22 11:58:38.950698"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 11:58:38.980135"], ["updated_at", "2020-12-22 11:58:38.980135"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608551918"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:38.984892"], ["updated_at", "2020-12-22 11:58:38.984892"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 105], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 11:58:39.002995"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 105]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 11:58:39.006774"], ["updated_at", "2020-12-22 11:58:39.006774"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608724719"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.010910"], ["updated_at", "2020-12-22 11:58:39.010910"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) 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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 11:58:39.015871"], ["updated_at", "2020-12-22 11:58:39.015871"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 107], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 107], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 11:58:39.018737"], ["id", 107]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 107], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.023270"], ["updated_at", "2020-12-22 11:58:39.023270"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.026627"], ["updated_at", "2020-12-22 11:58:39.026627"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.030529"], ["updated_at", "2020-12-22 11:58:39.030529"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.034248"], ["updated_at", "2020-12-22 11:58:39.034248"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.036186"], ["updated_at", "2020-12-22 11:58:39.036186"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.043170"], ["updated_at", "2020-12-22 11:58:39.043170"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.047828"], ["updated_at", "2020-12-22 11:58:39.047828"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 111], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 11:58:39.051638"], ["id", 111]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.056847"], ["updated_at", "2020-12-22 11:58:39.056847"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.059026"], ["updated_at", "2020-12-22 11:58:39.059026"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) 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.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 113], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 11:58:39.063878"], ["id", 113]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 113], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.067637"], ["updated_at", "2020-12-22 11:58:39.067637"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.069443"], ["updated_at", "2020-12-22 11:58:39.069443"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 115], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 11:58:39.072153"], ["id", 115]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 115], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "2020-12-22 11:58:39.077470"], ["updated_at", "2020-12-22 11:58:39.077470"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.081127"], ["updated_at", "2020-12-22 11:58:39.081127"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 11:58:39.084642"], ["updated_at", "2020-12-22 11:58:39.084642"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 11:58:39.089186"], ["updated_at", "2020-12-22 11:58:39.089186"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.091116"], ["updated_at", "2020-12-22 11:58:39.091116"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.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.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", "2020-12-22 11:58:39.096229"], ["updated_at", "2020-12-22 11:58:39.096229"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.098889"], ["updated_at", "2020-12-22 11:58:39.098889"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 11:58:39.102849"], ["updated_at", "2020-12-22 11:58:39.102849"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.104902"], ["updated_at", "2020-12-22 11:58:39.104902"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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]]  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.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", "2020-12-22 11:58:39.164207"], ["updated_at", "2020-12-22 11:58:39.164207"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 17ms (ActiveRecord: 6.2ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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.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", "2020-12-22 11:58:39.171034"], ["updated_at", "2020-12-22 11:58:39.171034"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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", "2020-12-22 11:58:39.177944"], ["updated_at", "2020-12-22 11:58:39.177944"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.5ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (1.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 11:58:39.188324"], ["updated_at", "2020-12-22 11:58:39.188324"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (0.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", "2020-12-22 11:58:39.197167"], ["updated_at", "2020-12-22 11:58:39.197167"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:39.200828"], ["updated_at", "2020-12-22 11:58:39.200828"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.204596"], ["updated_at", "2020-12-22 11:58:39.204596"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.206401"], ["updated_at", "2020-12-22 11:58:39.206401"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 156], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 11:58:39.209010"], ["id", 156]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 156], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.213723"], ["updated_at", "2020-12-22 11:58:39.213723"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.215379"], ["updated_at", "2020-12-22 11:58:39.215379"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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", "2020-12-22 11:58:39.217662"], ["id", 158]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 158], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.221422"], ["updated_at", "2020-12-22 11:58:39.221422"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.223304"], ["updated_at", "2020-12-22 11:58:39.223304"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 160], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 11:58:39.225731"], ["id", 160]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.231406"], ["updated_at", "2020-12-22 11:58:39.231406"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.234469"], ["updated_at", "2020-12-22 11:58:39.234469"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 162], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 11:58:39.237595"], ["id", 162]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.241339"], ["updated_at", "2020-12-22 11:58:39.241339"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 11:58:39.244321"], ["updated_at", "2020-12-22 11:58:39.244321"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.252775"], ["updated_at", "2020-12-22 11:58:39.252775"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:39.255436"], ["updated_at", "2020-12-22 11:58:39.255436"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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", "2020-12-22 11:58:39.258708"], ["updated_at", "2020-12-22 11:58:39.258708"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) 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]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:39.266059"], ["updated_at", "2020-12-22 11:58:39.266059"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.269976"], ["updated_at", "2020-12-22 11:58:39.269976"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:39.273253"], ["updated_at", "2020-12-22 11:58:39.273253"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 11:58:39.281178"], ["updated_at", "2020-12-22 11:58:39.281178"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 11:58:39.282512"], ["synced_id", 0], ["id", 171]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:39.287449"], ["updated_at", "2020-12-22 11:58:39.287449"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:39.290723"], ["updated_at", "2020-12-22 11:58:39.290723"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608551919"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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", 173], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 11:58:39.308900"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 173]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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", "2020-12-22 11:58:39.313190"], ["updated_at", "2020-12-22 11:58:39.313190"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608724719"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:39.318784"], ["updated_at", "2020-12-22 11:58:39.318784"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 175], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 175], ["LIMIT", 1]] Account Update (0.2ms) 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", "2020-12-22 11:58:39.321328"], ["id", 175]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 175], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:39.326058"], ["updated_at", "2020-12-22 11:58:39.326058"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:39.347009"], ["updated_at", "2020-12-22 11:58:39.347009"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:39.348950"], ["updated_at", "2020-12-22 11:58:39.348950"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:39.350611"], ["updated_at", "2020-12-22 11:58:39.350611"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:39.379818"], ["updated_at", "2020-12-22 11:58:39.379818"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.386397"], ["updated_at", "2020-12-22 11:58:39.386397"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:39.388226"], ["updated_at", "2020-12-22 11:58:39.388226"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:39.405228"], ["updated_at", "2020-12-22 11:58:39.405228"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 7ms (ActiveRecord: 0.0ms | Allocations: 1096)  (0.2ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 124)  (0.2ms) ROLLBACK  (0.1ms) 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]]  (0.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", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 11:58:53.484107"], ["updated_at", "2020-12-22 11:58:53.484107"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 69ms (ActiveRecord: 18.2ms | Allocations: 10182)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:53.490860"], ["updated_at", "2020-12-22 11:58:53.490860"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.9ms | Allocations: 878)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:53.502186"], ["updated_at", "2020-12-22 11:58:53.502186"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms | Allocations: 882)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (3.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", "2020-12-22 11:58:53.528067"], ["updated_at", "2020-12-22 11:58:53.528067"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 3.0ms | Allocations: 6502)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 2.6ms | Allocations: 264) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 21ms (Views: 12.7ms | ActiveRecord: 0.0ms | Allocations: 2703)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 0.1ms | Allocations: 54) 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 | Allocations: 429)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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", "2020-12-22 11:58:53.566170"], ["updated_at", "2020-12-22 11:58:53.566170"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608724733"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (4.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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", "2020-12-22 11:58:53.582757"], ["updated_at", "2020-12-22 11:58:53.582757"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 11:58:53.593322"], ["updated_at", "2020-12-22 11:58:53.593322"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608551933"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.597844"], ["updated_at", "2020-12-22 11:58:53.597844"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 131], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 11:58:53.629715"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 131]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.635092"], ["updated_at", "2020-12-22 11:58:53.635092"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists? (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists? (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.657574"], ["updated_at", "2020-12-22 11:58:53.657574"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.660551"], ["updated_at", "2020-12-22 11:58:53.660551"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.681228"], ["updated_at", "2020-12-22 11:58:53.681228"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.683528"], ["updated_at", "2020-12-22 11:58:53.683528"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 134], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 11:58:53.686997"], ["id", 134]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.691253"], ["updated_at", "2020-12-22 11:58:53.691253"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.693231"], ["updated_at", "2020-12-22 11:58:53.693231"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 136], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 11:58:53.696221"], ["id", 136]]  (0.2ms) 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", 136], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.702131"], ["updated_at", "2020-12-22 11:58:53.702131"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.705057"], ["updated_at", "2020-12-22 11:58:53.705057"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 138], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 11:58:53.708277"], ["id", 138]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 138], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.712877"], ["updated_at", "2020-12-22 11:58:53.712877"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.715411"], ["updated_at", "2020-12-22 11:58:53.715411"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 11:58:53.718884"], ["updated_at", "2020-12-22 11:58:53.718884"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.2ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 11:58:53.725143"], ["updated_at", "2020-12-22 11:58:53.725143"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.727195"], ["updated_at", "2020-12-22 11:58:53.727195"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 11:58:53.731394"], ["updated_at", "2020-12-22 11:58:53.731394"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.733482"], ["updated_at", "2020-12-22 11:58:53.733482"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 11:58:53.738176"], ["updated_at", "2020-12-22 11:58:53.738176"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.740235"], ["updated_at", "2020-12-22 11:58:53.740235"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.743338"], ["updated_at", "2020-12-22 11:58:53.743338"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.746042"], ["updated_at", "2020-12-22 11:58:53.746042"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.752804"], ["updated_at", "2020-12-22 11:58:53.752804"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.757057"], ["updated_at", "2020-12-22 11:58:53.757057"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.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", "2020-12-22 11:58:53.765861"], ["updated_at", "2020-12-22 11:58:53.765861"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 152], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 152], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 11:58:53.773054"], ["id", 152]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 152], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 11:58:53.777040"], ["updated_at", "2020-12-22 11:58:53.777040"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.781503"], ["updated_at", "2020-12-22 11:58:53.781503"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.785796"], ["updated_at", "2020-12-22 11:58:53.785796"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.789620"], ["updated_at", "2020-12-22 11:58:53.789620"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.794091"], ["updated_at", "2020-12-22 11:58:53.794091"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.796267"], ["updated_at", "2020-12-22 11:58:53.796267"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.798915"], ["updated_at", "2020-12-22 11:58:53.798915"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.801144"], ["updated_at", "2020-12-22 11:58:53.801144"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.807305"], ["updated_at", "2020-12-22 11:58:53.807305"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.862740"], ["updated_at", "2020-12-22 11:58:53.862740"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.864847"], ["updated_at", "2020-12-22 11:58:53.864847"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:53.869661"], ["updated_at", "2020-12-22 11:58:53.869661"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.876457"], ["updated_at", "2020-12-22 11:58:53.876457"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.884877"], ["updated_at", "2020-12-22 11:58:53.884877"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.898965"], ["updated_at", "2020-12-22 11:58:53.898965"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.913202"], ["updated_at", "2020-12-22 11:58:53.913202"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.922094"], ["updated_at", "2020-12-22 11:58:53.922094"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:53.930201"], ["updated_at", "2020-12-22 11:58:53.930201"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:53.942866"], ["updated_at", "2020-12-22 11:58:53.942866"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:53.946037"], ["updated_at", "2020-12-22 11:58:53.946037"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 186], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 186], ["LIMIT", 1]] Account Update (0.2ms) 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", "2020-12-22 11:58:53.949708"], ["id", 186]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 186], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:53.953512"], ["updated_at", "2020-12-22 11:58:53.953512"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 11:58:53.957332"], ["updated_at", "2020-12-22 11:58:53.957332"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 11:58:53.958541"], ["synced_id", 0], ["id", 188]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:53.966935"], ["updated_at", "2020-12-22 11:58:53.966935"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.970365"], ["updated_at", "2020-12-22 11:58:53.970365"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.972647"], ["updated_at", "2020-12-22 11:58:53.972647"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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.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", "2020-12-22 11:58:53.974976"], ["id", 191]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.978189"], ["updated_at", "2020-12-22 11:58:53.978189"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.980104"], ["updated_at", "2020-12-22 11:58:53.980104"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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.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", "2020-12-22 11:58:53.983328"], ["id", 193]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.986551"], ["updated_at", "2020-12-22 11:58:53.986551"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.988813"], ["updated_at", "2020-12-22 11:58:53.988813"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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.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", "2020-12-22 11:58:53.991309"], ["id", 195]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 195], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.994858"], ["updated_at", "2020-12-22 11:58:53.994858"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:53.996994"], ["updated_at", "2020-12-22 11:58:53.996994"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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 (0.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", "2020-12-22 11:58:53.999556"], ["id", 197]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 197], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:54.004737"], ["updated_at", "2020-12-22 11:58:54.004737"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:54.007984"], ["updated_at", "2020-12-22 11:58:54.007984"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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", "2020-12-22 11:58:54.011952"], ["updated_at", "2020-12-22 11:58:54.011952"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:54.015152"], ["updated_at", "2020-12-22 11:58:54.015152"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:54.018409"], ["updated_at", "2020-12-22 11:58:54.018409"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:54.021498"], ["updated_at", "2020-12-22 11:58:54.021498"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 11:58:54.024714"], ["updated_at", "2020-12-22 11:58:54.024714"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:54.027009"], ["updated_at", "2020-12-22 11:58:54.027009"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:54.030630"], ["updated_at", "2020-12-22 11:58:54.030630"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608724734"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 11:58:54.034520"], ["updated_at", "2020-12-22 11:58:54.034520"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608551934"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 207], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 11:58:54.055657"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 207]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:54.059708"], ["updated_at", "2020-12-22 11:58:54.059708"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:54.061391"], ["updated_at", "2020-12-22 11:58:54.061391"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:54.063451"], ["updated_at", "2020-12-22 11:58:54.063451"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 11:58:54.067014"], ["updated_at", "2020-12-22 11:58:54.067014"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 11:58:54.112288"], ["updated_at", "2020-12-22 11:58:54.112288"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (Duration: 0.0ms | Allocations: 3) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 5ms (Views: 4.7ms | ActiveRecord: 0.0ms | Allocations: 573)  (0.4ms) ROLLBACK  (0.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 | Allocations: 94)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 3.6ms | ActiveRecord: 0.0ms | Allocations: 333)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 182)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.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]] SQL (2.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", "2020-12-22 12:35:58.717591"], ["updated_at", "2020-12-22 12:35:58.717591"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 161], ["LIMIT", 1]]  (0.1ms) 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", 161], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:58.739936"], ["id", 161]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 161], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.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", "2020-12-22 12:35:58.746462"], ["updated_at", "2020-12-22 12:35:58.746462"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:58.751390"], ["updated_at", "2020-12-22 12:35:58.751390"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (3.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.765653"], ["updated_at", "2020-12-22 12:35:58.765653"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:58.779911"], ["updated_at", "2020-12-22 12:35:58.779911"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.786093"], ["updated_at", "2020-12-22 12:35:58.786093"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.789125"], ["updated_at", "2020-12-22 12:35:58.789125"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.798441"], ["updated_at", "2020-12-22 12:35:58.798441"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.851268"], ["updated_at", "2020-12-22 12:35:58.851268"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.853179"], ["updated_at", "2020-12-22 12:35:58.853179"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.859173"], ["updated_at", "2020-12-22 12:35:58.859173"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.861881"], ["updated_at", "2020-12-22 12:35:58.861881"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:35:58.866327"], ["updated_at", "2020-12-22 12:35:58.866327"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.4ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:35:58.871620"], ["updated_at", "2020-12-22 12:35:58.871620"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.873688"], ["updated_at", "2020-12-22 12:35:58.873688"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:35:58.878765"], ["updated_at", "2020-12-22 12:35:58.878765"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.881253"], ["updated_at", "2020-12-22 12:35:58.881253"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:35:58.885740"], ["updated_at", "2020-12-22 12:35:58.885740"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.887670"], ["updated_at", "2020-12-22 12:35:58.887670"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.892567"], ["updated_at", "2020-12-22 12:35:58.892567"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.894695"], ["updated_at", "2020-12-22 12:35:58.894695"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 176], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:58.898281"], ["id", 176]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.902155"], ["updated_at", "2020-12-22 12:35:58.902155"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.904140"], ["updated_at", "2020-12-22 12:35:58.904140"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 178], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:58.906649"], ["id", 178]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 178], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.910296"], ["updated_at", "2020-12-22 12:35:58.910296"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.912738"], ["updated_at", "2020-12-22 12:35:58.912738"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 180], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:58.915769"], ["id", 180]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 180], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:58.921490"], ["updated_at", "2020-12-22 12:35:58.921490"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.926812"], ["updated_at", "2020-12-22 12:35:58.926812"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:58.966132"], ["updated_at", "2020-12-22 12:35:58.966132"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:58.969875"], ["updated_at", "2020-12-22 12:35:58.969875"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:58.972569"], ["updated_at", "2020-12-22 12:35:58.972569"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:58.976088"], ["updated_at", "2020-12-22 12:35:58.976088"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:35:58.985881"], ["updated_at", "2020-12-22 12:35:58.985881"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608726958"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:58.990630"], ["updated_at", "2020-12-22 12:35:58.990630"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:35:58.996943"], ["updated_at", "2020-12-22 12:35:58.996943"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608554158"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:59.001703"], ["updated_at", "2020-12-22 12:35:59.001703"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 188], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 12:35:59.022794"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 188]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:59.029560"], ["updated_at", "2020-12-22 12:35:59.029560"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) 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.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 5ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 12ms (Views: 10.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.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]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 12:35:59.149525"], ["updated_at", "2020-12-22 12:35:59.149525"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 15ms (ActiveRecord: 5.4ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 12:35:59.157927"], ["updated_at", "2020-12-22 12:35:59.157927"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 2.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.165779"], ["updated_at", "2020-12-22 12:35:59.165779"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:35:59.174979"], ["updated_at", "2020-12-22 12:35:59.174979"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.3ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:35:59.184366"], ["updated_at", "2020-12-22 12:35:59.184366"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 12:35:59.209807"], ["updated_at", "2020-12-22 12:35:59.209807"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 12:35:59.211450"], ["synced_id", 0], ["id", 216]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 12:35:59.217981"], ["updated_at", "2020-12-22 12:35:59.217981"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608554159"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 217], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 12:35:59.236312"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 217]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.239634"], ["updated_at", "2020-12-22 12:35:59.239634"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608726959"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.242582"], ["updated_at", "2020-12-22 12:35:59.242582"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:35:59.246619"], ["updated_at", "2020-12-22 12:35:59.246619"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:35:59.248527"], ["updated_at", "2020-12-22 12:35:59.248527"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:35:59.250249"], ["updated_at", "2020-12-22 12:35:59.250249"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:35:59.254409"], ["updated_at", "2020-12-22 12:35:59.254409"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.257535"], ["updated_at", "2020-12-22 12:35:59.257535"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 224], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 224], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.260271"], ["id", 224]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 224], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:35:59.265491"], ["updated_at", "2020-12-22 12:35:59.265491"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.269479"], ["updated_at", "2020-12-22 12:35:59.269479"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.271374"], ["updated_at", "2020-12-22 12:35:59.271374"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 227], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.273834"], ["id", 227]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.276852"], ["updated_at", "2020-12-22 12:35:59.276852"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.279157"], ["updated_at", "2020-12-22 12:35:59.279157"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 229], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.282121"], ["id", 229]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.285992"], ["updated_at", "2020-12-22 12:35:59.285992"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.287744"], ["updated_at", "2020-12-22 12:35:59.287744"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 231], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.290201"], ["id", 231]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 231], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.293801"], ["updated_at", "2020-12-22 12:35:59.293801"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.296217"], ["updated_at", "2020-12-22 12:35:59.296217"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 233], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.299469"], ["id", 233]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 233], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.304799"], ["updated_at", "2020-12-22 12:35:59.304799"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.308098"], ["updated_at", "2020-12-22 12:35:59.308098"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.312832"], ["updated_at", "2020-12-22 12:35:59.312832"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (5.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", "2020-12-22 12:35:59.316217"], ["updated_at", "2020-12-22 12:35:59.316217"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) 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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.327275"], ["updated_at", "2020-12-22 12:35:59.327275"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.331494"], ["updated_at", "2020-12-22 12:35:59.331494"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.334869"], ["updated_at", "2020-12-22 12:35:59.334869"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:35:59.337492"], ["updated_at", "2020-12-22 12:35:59.337492"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:59.347333"], ["updated_at", "2020-12-22 12:35:59.347333"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.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 5ms (Views: 4.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:35:59.378596"], ["updated_at", "2020-12-22 12:35:59.378596"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.383911"], ["updated_at", "2020-12-22 12:35:59.383911"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:35:59.386510"], ["updated_at", "2020-12-22 12:35:59.386510"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:59.397554"], ["updated_at", "2020-12-22 12:35:59.397554"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:59.406445"], ["updated_at", "2020-12-22 12:35:59.406445"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:59.419931"], ["updated_at", "2020-12-22 12:35:59.419931"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:59.427280"], ["updated_at", "2020-12-22 12:35:59.427280"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:59.437772"], ["updated_at", "2020-12-22 12:35:59.437772"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:35:59.454495"], ["updated_at", "2020-12-22 12:35:59.454495"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 12ms (Views: 11.3ms | ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.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 2ms (Views: 1.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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 19ms (Views: 18.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.597054"], ["updated_at", "2020-12-22 12:36:11.597054"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.610763"], ["updated_at", "2020-12-22 12:36:11.610763"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.616498"], ["updated_at", "2020-12-22 12:36:11.616498"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.624090"], ["updated_at", "2020-12-22 12:36:11.624090"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.629555"], ["updated_at", "2020-12-22 12:36:11.629555"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.636036"], ["updated_at", "2020-12-22 12:36:11.636036"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.642119"], ["updated_at", "2020-12-22 12:36:11.642119"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.646427"], ["updated_at", "2020-12-22 12:36:11.646427"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.657446"], ["updated_at", "2020-12-22 12:36:11.657446"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.661950"], ["updated_at", "2020-12-22 12:36:11.661950"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 252], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.670940"], ["id", 252]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.679328"], ["updated_at", "2020-12-22 12:36:11.679328"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.682917"], ["updated_at", "2020-12-22 12:36:11.682917"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 254], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.687672"], ["id", 254]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 254], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.694026"], ["updated_at", "2020-12-22 12:36:11.694026"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.696455"], ["updated_at", "2020-12-22 12:36:11.696455"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 256], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.700726"], ["id", 256]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 256], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.707906"], ["updated_at", "2020-12-22 12:36:11.707906"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.710476"], ["updated_at", "2020-12-22 12:36:11.710476"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 258], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.715540"], ["id", 258]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.721685"], ["updated_at", "2020-12-22 12:36:11.721685"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 12:36:11.741413"], ["updated_at", "2020-12-22 12:36:11.741413"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 12:36:11.743352"], ["synced_id", 0], ["id", 260]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:11.776152"], ["updated_at", "2020-12-22 12:36:11.776152"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.781392"], ["updated_at", "2020-12-22 12:36:11.781392"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608554171"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.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]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 12:36:11.812475"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 262]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.816374"], ["updated_at", "2020-12-22 12:36:11.816374"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608726971"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:11.842843"], ["updated_at", "2020-12-22 12:36:11.842843"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:11.844600"], ["updated_at", "2020-12-22 12:36:11.844600"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:11.846287"], ["updated_at", "2020-12-22 12:36:11.846287"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:11.855387"], ["updated_at", "2020-12-22 12:36:11.855387"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:11.858587"], ["updated_at", "2020-12-22 12:36:11.858587"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.876480"], ["updated_at", "2020-12-22 12:36:11.876480"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 269], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 269], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:11.879200"], ["id", 269]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 269], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (6.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]] SQL (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", "2020-12-22 12:36:11.906652"], ["updated_at", "2020-12-22 12:36:11.906652"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:36:11.911145"], ["updated_at", "2020-12-22 12:36:11.911145"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608554171"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (4.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:11.926401"], ["updated_at", "2020-12-22 12:36:11.926401"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 194], ["host", "example.test"], ["LIMIT", 1]] SQL (2.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 12:36:11.944582"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 194]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:36:11.950797"], ["updated_at", "2020-12-22 12:36:11.950797"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608726971"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:11.954425"], ["updated_at", "2020-12-22 12:36:11.954425"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:11.958424"], ["updated_at", "2020-12-22 12:36:11.958424"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:11.961316"], ["updated_at", "2020-12-22 12:36:11.961316"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:11.979769"], ["updated_at", "2020-12-22 12:36:11.979769"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 12:36:11.982824"], ["updated_at", "2020-12-22 12:36:11.982824"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:11.990927"], ["updated_at", "2020-12-22 12:36:11.990927"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:11.994364"], ["updated_at", "2020-12-22 12:36:11.994364"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:36:11.999131"], ["updated_at", "2020-12-22 12:36:11.999131"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.3ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:36:12.004865"], ["updated_at", "2020-12-22 12:36:12.004865"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.007037"], ["updated_at", "2020-12-22 12:36:12.007037"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:36:12.011543"], ["updated_at", "2020-12-22 12:36:12.011543"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 12:36:12.014254"], ["updated_at", "2020-12-22 12:36:12.014254"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:36:12.020649"], ["updated_at", "2020-12-22 12:36:12.020649"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.023387"], ["updated_at", "2020-12-22 12:36:12.023387"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.027466"], ["updated_at", "2020-12-22 12:36:12.027466"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.030001"], ["updated_at", "2020-12-22 12:36:12.030001"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 208], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 12:36:12.034584"], ["id", 208]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.039067"], ["updated_at", "2020-12-22 12:36:12.039067"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.041069"], ["updated_at", "2020-12-22 12:36:12.041069"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 210], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:12.043677"], ["id", 210]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 210], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.047882"], ["updated_at", "2020-12-22 12:36:12.047882"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.050273"], ["updated_at", "2020-12-22 12:36:12.050273"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) 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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 212], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:12.053996"], ["id", 212]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 212], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:12.058236"], ["updated_at", "2020-12-22 12:36:12.058236"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:12.060084"], ["updated_at", "2020-12-22 12:36:12.060084"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:12.061970"], ["updated_at", "2020-12-22 12:36:12.061970"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:12.064037"], ["updated_at", "2020-12-22 12:36:12.064037"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:12.069272"], ["updated_at", "2020-12-22 12:36:12.069272"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.072533"], ["updated_at", "2020-12-22 12:36:12.072533"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.075560"], ["updated_at", "2020-12-22 12:36:12.075560"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:36:12.079270"], ["updated_at", "2020-12-22 12:36:12.079270"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 219], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 219], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:12.082865"], ["id", 219]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 219], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.088161"], ["updated_at", "2020-12-22 12:36:12.088161"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:12.096942"], ["updated_at", "2020-12-22 12:36:12.096942"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.101073"], ["updated_at", "2020-12-22 12:36:12.101073"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.106539"], ["updated_at", "2020-12-22 12:36:12.106539"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.111831"], ["updated_at", "2020-12-22 12:36:12.111831"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.121109"], ["updated_at", "2020-12-22 12:36:12.121109"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.128123"], ["updated_at", "2020-12-22 12:36:12.128123"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.142034"], ["updated_at", "2020-12-22 12:36:12.142034"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) 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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.158833"], ["updated_at", "2020-12-22 12:36:12.158833"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.168627"], ["updated_at", "2020-12-22 12:36:12.168627"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:12.203297"], ["updated_at", "2020-12-22 12:36:12.203297"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:12.209550"], ["updated_at", "2020-12-22 12:36:12.209550"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:36:12.220736"], ["updated_at", "2020-12-22 12:36:12.220736"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:36:12.228578"], ["updated_at", "2020-12-22 12:36:12.228578"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 4ms (Views: 2.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:12.263466"], ["updated_at", "2020-12-22 12:36:12.263466"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:12.266362"], ["updated_at", "2020-12-22 12:36:12.266362"], ["synced_id", 123], ["host", "test.host"]]  (0.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 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:12.274222"], ["updated_at", "2020-12-22 12:36:12.274222"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:12.280900"], ["updated_at", "2020-12-22 12:36:12.280900"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (3.8ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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 (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:23.892741"], ["updated_at", "2020-12-22 12:36:23.892741"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:23.895665"], ["updated_at", "2020-12-22 12:36:23.895665"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:23.916064"], ["updated_at", "2020-12-22 12:36:23.916064"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:23.922513"], ["updated_at", "2020-12-22 12:36:23.922513"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:23.939206"], ["updated_at", "2020-12-22 12:36:23.939206"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (3.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 (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:23.955908"], ["updated_at", "2020-12-22 12:36:23.955908"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:23.965387"], ["updated_at", "2020-12-22 12:36:23.965387"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 12:36:23.998449"], ["updated_at", "2020-12-22 12:36:23.998449"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608554183"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.003563"], ["updated_at", "2020-12-22 12:36:24.003563"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 229], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 12:36:24.033324"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 229]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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", "2020-12-22 12:36:24.036991"], ["updated_at", "2020-12-22 12:36:24.036991"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608726984"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.039822"], ["updated_at", "2020-12-22 12:36:24.039822"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.043650"], ["updated_at", "2020-12-22 12:36:24.043650"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.046415"], ["updated_at", "2020-12-22 12:36:24.046415"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.049200"], ["updated_at", "2020-12-22 12:36:24.049200"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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", "2020-12-22 12:36:24.053984"], ["updated_at", "2020-12-22 12:36:24.053984"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.057150"], ["updated_at", "2020-12-22 12:36:24.057150"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.063014"], ["updated_at", "2020-12-22 12:36:24.063014"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.064799"], ["updated_at", "2020-12-22 12:36:24.064799"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 12:36:24.071921"], ["updated_at", "2020-12-22 12:36:24.071921"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 12:36:24.076444"], ["updated_at", "2020-12-22 12:36:24.076444"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.078466"], ["updated_at", "2020-12-22 12:36:24.078466"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 12:36:24.082360"], ["updated_at", "2020-12-22 12:36:24.082360"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.084537"], ["updated_at", "2020-12-22 12:36:24.084537"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 12:36:24.089135"], ["updated_at", "2020-12-22 12:36:24.089135"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.091763"], ["updated_at", "2020-12-22 12:36:24.091763"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.096881"], ["updated_at", "2020-12-22 12:36:24.096881"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.098768"], ["updated_at", "2020-12-22 12:36:24.098768"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 243], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 12:36:24.102108"], ["id", 243]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.106166"], ["updated_at", "2020-12-22 12:36:24.106166"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.108705"], ["updated_at", "2020-12-22 12:36:24.108705"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 245], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 12:36:24.111410"], ["id", 245]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 245], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.115620"], ["updated_at", "2020-12-22 12:36:24.115620"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.118837"], ["updated_at", "2020-12-22 12:36:24.118837"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 247], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 12:36:24.124631"], ["id", 247]]  (0.2ms) 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", 247], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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", "2020-12-22 12:36:24.133235"], ["updated_at", "2020-12-22 12:36:24.133235"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 12:36:24.143239"], ["updated_at", "2020-12-22 12:36:24.143239"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 250], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 250], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 12:36:24.145983"], ["id", 250]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 250], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.149867"], ["updated_at", "2020-12-22 12:36:24.149867"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.153693"], ["updated_at", "2020-12-22 12:36:24.153693"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.173142"], ["updated_at", "2020-12-22 12:36:24.173142"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.175071"], ["updated_at", "2020-12-22 12:36:24.175071"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.176848"], ["updated_at", "2020-12-22 12:36:24.176848"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.178646"], ["updated_at", "2020-12-22 12:36:24.178646"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:24.183013"], ["updated_at", "2020-12-22 12:36:24.183013"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608554184"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 275], ["LIMIT", 1]] Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 12:36:24.199622"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 275]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:24.203249"], ["updated_at", "2020-12-22 12:36:24.203249"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608726984"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 12:36:24.210068"], ["updated_at", "2020-12-22 12:36:24.210068"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 12:36:24.211402"], ["synced_id", 0], ["id", 277]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:24.217057"], ["updated_at", "2020-12-22 12:36:24.217057"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:24.222239"], ["updated_at", "2020-12-22 12:36:24.222239"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:24.225658"], ["updated_at", "2020-12-22 12:36:24.225658"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.229381"], ["updated_at", "2020-12-22 12:36:24.229381"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:24.232357"], ["updated_at", "2020-12-22 12:36:24.232357"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.236368"], ["updated_at", "2020-12-22 12:36:24.236368"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:24.239186"], ["updated_at", "2020-12-22 12:36:24.239186"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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", "2020-12-22 12:36:24.243132"], ["updated_at", "2020-12-22 12:36:24.243132"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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.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", "2020-12-22 12:36:24.247952"], ["updated_at", "2020-12-22 12:36:24.247952"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (1.0ms) 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.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.255398"], ["updated_at", "2020-12-22 12:36:24.255398"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) 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.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 12:36:24.261360"], ["updated_at", "2020-12-22 12:36:24.261360"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.9ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.275216"], ["updated_at", "2020-12-22 12:36:24.275216"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.278401"], ["updated_at", "2020-12-22 12:36:24.278401"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 290], ["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", "2020-12-22 12:36:24.282085"], ["id", 290]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.286707"], ["updated_at", "2020-12-22 12:36:24.286707"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.288950"], ["updated_at", "2020-12-22 12:36:24.288950"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 292], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 12:36:24.291828"], ["id", 292]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.295225"], ["updated_at", "2020-12-22 12:36:24.295225"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.296934"], ["updated_at", "2020-12-22 12:36:24.296934"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 294], ["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", "2020-12-22 12:36:24.299740"], ["id", 294]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 294], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.304607"], ["updated_at", "2020-12-22 12:36:24.304607"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:24.306653"], ["updated_at", "2020-12-22 12:36:24.306653"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 296], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 12:36:24.309215"], ["id", 296]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 296], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:24.313143"], ["updated_at", "2020-12-22 12:36:24.313143"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 297], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 297], ["LIMIT", 1]] Account Update (0.2ms) 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", "2020-12-22 12:36:24.315809"], ["id", 297]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 297], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:24.320137"], ["updated_at", "2020-12-22 12:36:24.320137"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:24.321942"], ["updated_at", "2020-12-22 12:36:24.321942"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:24.323737"], ["updated_at", "2020-12-22 12:36:24.323737"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:24.329040"], ["updated_at", "2020-12-22 12:36:24.329040"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:24.349702"], ["updated_at", "2020-12-22 12:36:24.349702"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:24.359579"], ["updated_at", "2020-12-22 12:36:24.359579"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 12:36:24.365776"], ["updated_at", "2020-12-22 12:36:24.365776"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 12:36:24.379634"], ["updated_at", "2020-12-22 12:36:24.379634"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.5ms)  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 6.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 4ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.449999"], ["updated_at", "2020-12-22 12:36:24.449999"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.459405"], ["updated_at", "2020-12-22 12:36:24.459405"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.466818"], ["updated_at", "2020-12-22 12:36:24.466818"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.482977"], ["updated_at", "2020-12-22 12:36:24.482977"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.522781"], ["updated_at", "2020-12-22 12:36:24.522781"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.534644"], ["updated_at", "2020-12-22 12:36:24.534644"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:24.547708"], ["updated_at", "2020-12-22 12:36:24.547708"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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? (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.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", "2020-12-22 12:36:39.198114"], ["updated_at", "2020-12-22 12:36:39.198114"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.271804"], ["updated_at", "2020-12-22 12:36:39.271804"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.281026"], ["updated_at", "2020-12-22 12:36:39.281026"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.293430"], ["updated_at", "2020-12-22 12:36:39.293430"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.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? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.305857"], ["updated_at", "2020-12-22 12:36:39.305857"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.319156"], ["updated_at", "2020-12-22 12:36:39.319156"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.4ms) 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.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 3) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 35ms (Views: 23.6ms | ActiveRecord: 0.0ms | Allocations: 2246)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 165)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (Duration: 0.0ms | Allocations: 3) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.0ms | Allocations: 366)  (0.2ms) ROLLBACK  (0.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 | Allocations: 108)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 170)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 124)  (0.1ms) ROLLBACK  (0.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]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.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", "2020-12-22 12:36:39.435116"], ["updated_at", "2020-12-22 12:36:39.435116"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 17ms (ActiveRecord: 5.8ms | Allocations: 6551)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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.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", "2020-12-22 12:36:39.441940"], ["updated_at", "2020-12-22 12:36:39.441940"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.4ms | Allocations: 878)  (4.5ms) ROLLBACK  (0.1ms) BEGIN  (2.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 12:36:39.472059"], ["updated_at", "2020-12-22 12:36:39.472059"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 3.0ms | Allocations: 6468)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:39.484090"], ["updated_at", "2020-12-22 12:36:39.484090"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.2ms | Allocations: 882)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 2.6ms | Allocations: 262) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 14ms (Views: 4.7ms | ActiveRecord: 0.0ms | Allocations: 1925)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 0.2ms | Allocations: 54) 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 | Allocations: 429)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 12:36:39.513970"], ["updated_at", "2020-12-22 12:36:39.513970"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 258], ["LIMIT", 1]]  (0.1ms) 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", 258], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 12:36:39.521700"], ["id", 258]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 258], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.526401"], ["updated_at", "2020-12-22 12:36:39.526401"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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 (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists? (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.536941"], ["updated_at", "2020-12-22 12:36:39.536941"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.539751"], ["updated_at", "2020-12-22 12:36:39.539751"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.548027"], ["updated_at", "2020-12-22 12:36:39.548027"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.587330"], ["updated_at", "2020-12-22 12:36:39.587330"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.590273"], ["updated_at", "2020-12-22 12:36:39.590273"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.638515"], ["updated_at", "2020-12-22 12:36:39.638515"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.641448"], ["updated_at", "2020-12-22 12:36:39.641448"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.644271"], ["updated_at", "2020-12-22 12:36:39.644271"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.648658"], ["updated_at", "2020-12-22 12:36:39.648658"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.650494"], ["updated_at", "2020-12-22 12:36:39.650494"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 12:36:39.653342"], ["updated_at", "2020-12-22 12:36:39.653342"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 12:36:39.657503"], ["updated_at", "2020-12-22 12:36:39.657503"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.659620"], ["updated_at", "2020-12-22 12:36:39.659620"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (1.1ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 12:36:39.666206"], ["updated_at", "2020-12-22 12:36:39.666206"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.668043"], ["updated_at", "2020-12-22 12:36:39.668043"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 12:36:39.671614"], ["updated_at", "2020-12-22 12:36:39.671614"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.673441"], ["updated_at", "2020-12-22 12:36:39.673441"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.676431"], ["updated_at", "2020-12-22 12:36:39.676431"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.678667"], ["updated_at", "2020-12-22 12:36:39.678667"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 12:36:39.682465"], ["id", 272]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.685817"], ["updated_at", "2020-12-22 12:36:39.685817"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.687576"], ["updated_at", "2020-12-22 12:36:39.687576"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 274], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 12:36:39.690047"], ["id", 274]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 274], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.693584"], ["updated_at", "2020-12-22 12:36:39.693584"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.695587"], ["updated_at", "2020-12-22 12:36:39.695587"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 276], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 12:36:39.699394"], ["id", 276]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 276], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.703078"], ["updated_at", "2020-12-22 12:36:39.703078"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.704852"], ["updated_at", "2020-12-22 12:36:39.704852"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.711090"], ["updated_at", "2020-12-22 12:36:39.711090"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.713481"], ["updated_at", "2020-12-22 12:36:39.713481"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.716132"], ["updated_at", "2020-12-22 12:36:39.716132"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.718682"], ["updated_at", "2020-12-22 12:36:39.718682"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 12:36:39.724206"], ["updated_at", "2020-12-22 12:36:39.724206"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608554199"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.727384"], ["updated_at", "2020-12-22 12:36:39.727384"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 284], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 12:36:39.748758"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 284]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 12:36:39.752838"], ["updated_at", "2020-12-22 12:36:39.752838"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608726999"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.755907"], ["updated_at", "2020-12-22 12:36:39.755907"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 12:36:39.759754"], ["updated_at", "2020-12-22 12:36:39.759754"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:36:39.770821"], ["updated_at", "2020-12-22 12:36:39.770821"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:39.788216"], ["updated_at", "2020-12-22 12:36:39.788216"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:39.789874"], ["updated_at", "2020-12-22 12:36:39.789874"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:39.791390"], ["updated_at", "2020-12-22 12:36:39.791390"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:39.795014"], ["updated_at", "2020-12-22 12:36:39.795014"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 12:36:39.798891"], ["updated_at", "2020-12-22 12:36:39.798891"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 12:36:39.800169"], ["synced_id", 0], ["id", 312]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:39.805107"], ["updated_at", "2020-12-22 12:36:39.805107"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:39.807998"], ["updated_at", "2020-12-22 12:36:39.807998"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:39.826298"], ["updated_at", "2020-12-22 12:36:39.826298"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 315], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 315], ["LIMIT", 1]] Account Update (0.5ms) 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", "2020-12-22 12:36:39.829886"], ["id", 315]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 315], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.835147"], ["updated_at", "2020-12-22 12:36:39.835147"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:39.837998"], ["updated_at", "2020-12-22 12:36:39.837998"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.841334"], ["updated_at", "2020-12-22 12:36:39.841334"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:39.843693"], ["updated_at", "2020-12-22 12:36:39.843693"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.847481"], ["updated_at", "2020-12-22 12:36:39.847481"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:39.850290"], ["updated_at", "2020-12-22 12:36:39.850290"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.852957"], ["updated_at", "2020-12-22 12:36:39.852957"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:39.855183"], ["updated_at", "2020-12-22 12:36:39.855183"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.858359"], ["updated_at", "2020-12-22 12:36:39.858359"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.860052"], ["updated_at", "2020-12-22 12:36:39.860052"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.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 (0.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", "2020-12-22 12:36:39.862406"], ["id", 325]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.866558"], ["updated_at", "2020-12-22 12:36:39.866558"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.868558"], ["updated_at", "2020-12-22 12:36:39.868558"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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 (0.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", "2020-12-22 12:36:39.870871"], ["id", 327]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.873729"], ["updated_at", "2020-12-22 12:36:39.873729"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.875352"], ["updated_at", "2020-12-22 12:36:39.875352"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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 (0.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", "2020-12-22 12:36:39.877681"], ["id", 329]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 329], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.882792"], ["updated_at", "2020-12-22 12:36:39.882792"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.884491"], ["updated_at", "2020-12-22 12:36:39.884491"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.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 (0.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", "2020-12-22 12:36:39.886870"], ["id", 331]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 331], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:39.891982"], ["updated_at", "2020-12-22 12:36:39.891982"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 12:36:39.895390"], ["updated_at", "2020-12-22 12:36:39.895390"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608554199"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 333], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 12:36:39.910845"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 333]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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", "2020-12-22 12:36:39.914991"], ["updated_at", "2020-12-22 12:36:39.914991"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608726999"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.920888"], ["updated_at", "2020-12-22 12:36:39.920888"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:36:39.922713"], ["updated_at", "2020-12-22 12:36:39.922713"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:36:39.926974"], ["updated_at", "2020-12-22 12:36:39.926974"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (5.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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (10.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:41.934559"], ["updated_at", "2020-12-22 12:52:41.934559"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.276757"], ["updated_at", "2020-12-22 12:52:42.276757"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.309396"], ["updated_at", "2020-12-22 12:52:42.309396"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.5ms) 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 (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (4.1ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.352370"], ["updated_at", "2020-12-22 12:52:42.352370"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) 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.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.364887"], ["updated_at", "2020-12-22 12:52:42.364887"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.388194"], ["updated_at", "2020-12-22 12:52:42.388194"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.415120"], ["updated_at", "2020-12-22 12:52:42.415120"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.8ms) 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]] SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:52:42.446720"], ["updated_at", "2020-12-22 12:52:42.446720"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 12:52:42.464878"], ["updated_at", "2020-12-22 12:52:42.464878"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 12:52:42.466747"], ["synced_id", 0], ["id", 337]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:52:42.475633"], ["updated_at", "2020-12-22 12:52:42.475633"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.527699"], ["updated_at", "2020-12-22 12:52:42.527699"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.535463"], ["updated_at", "2020-12-22 12:52:42.535463"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.539878"], ["updated_at", "2020-12-22 12:52:42.539878"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.542932"], ["updated_at", "2020-12-22 12:52:42.542932"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.546252"], ["updated_at", "2020-12-22 12:52:42.546252"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.548908"], ["updated_at", "2020-12-22 12:52:42.548908"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.552189"], ["updated_at", "2020-12-22 12:52:42.552189"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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]] SQL (0.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", "2020-12-22 12:52:42.555587"], ["updated_at", "2020-12-22 12:52:42.555587"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.562220"], ["updated_at", "2020-12-22 12:52:42.562220"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.564159"], ["updated_at", "2020-12-22 12:52:42.564159"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 348], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.567210"], ["id", 348]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 348], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.572516"], ["updated_at", "2020-12-22 12:52:42.572516"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.579734"], ["updated_at", "2020-12-22 12:52:42.579734"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 350], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.582589"], ["id", 350]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 350], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.587682"], ["updated_at", "2020-12-22 12:52:42.587682"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.591726"], ["updated_at", "2020-12-22 12:52:42.591726"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 352], ["LIMIT", 1]] SQL (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", "2020-12-22 12:52:42.595542"], ["id", 352]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.599775"], ["updated_at", "2020-12-22 12:52:42.599775"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.602159"], ["updated_at", "2020-12-22 12:52:42.602159"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 354], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.605277"], ["id", 354]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.609487"], ["updated_at", "2020-12-22 12:52:42.609487"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 355], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 355], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.616171"], ["id", 355]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 355], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.626755"], ["updated_at", "2020-12-22 12:52:42.626755"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608555162"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 356], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 12:52:42.655378"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 356]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.658922"], ["updated_at", "2020-12-22 12:52:42.658922"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608727962"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:52:42.662332"], ["updated_at", "2020-12-22 12:52:42.662332"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:52:42.683877"], ["updated_at", "2020-12-22 12:52:42.683877"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.688432"], ["updated_at", "2020-12-22 12:52:42.688432"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:52:42.694062"], ["updated_at", "2020-12-22 12:52:42.694062"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:52:42.696010"], ["updated_at", "2020-12-22 12:52:42.696010"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:52:42.698236"], ["updated_at", "2020-12-22 12:52:42.698236"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.713614"], ["updated_at", "2020-12-22 12:52:42.713614"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.724222"], ["updated_at", "2020-12-22 12:52:42.724222"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (2.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 12:52:42.772266"], ["updated_at", "2020-12-22 12:52:42.772266"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 40ms (ActiveRecord: 3.8ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.783961"], ["updated_at", "2020-12-22 12:52:42.783961"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.5ms) SELECT COUNT(*) FROM "accounts" Account Load (1.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 14ms (Views: 11.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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: 3.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.4ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:52:42.841283"], ["updated_at", "2020-12-22 12:52:42.841283"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.host"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.847848"], ["updated_at", "2020-12-22 12:52:42.847848"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.850134"], ["updated_at", "2020-12-22 12:52:42.850134"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.854717"], ["updated_at", "2020-12-22 12:52:42.854717"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.859575"], ["updated_at", "2020-12-22 12:52:42.859575"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.864580"], ["updated_at", "2020-12-22 12:52:42.864580"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.866961"], ["updated_at", "2020-12-22 12:52:42.866961"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 293], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.870634"], ["id", 293]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.874422"], ["updated_at", "2020-12-22 12:52:42.874422"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.877043"], ["updated_at", "2020-12-22 12:52:42.877043"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 295], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:42.879759"], ["id", 295]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 295], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.884592"], ["updated_at", "2020-12-22 12:52:42.884592"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.887341"], ["updated_at", "2020-12-22 12:52:42.887341"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 297], ["host", "example.test"], ["LIMIT", 1]] SQL (2.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", "2020-12-22 12:52:42.890809"], ["id", 297]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 297], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.899256"], ["updated_at", "2020-12-22 12:52:42.899256"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.902055"], ["updated_at", "2020-12-22 12:52:42.902055"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:52:42.905763"], ["updated_at", "2020-12-22 12:52:42.905763"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:52:42.911205"], ["updated_at", "2020-12-22 12:52:42.911205"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.913522"], ["updated_at", "2020-12-22 12:52:42.913522"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:52:42.917562"], ["updated_at", "2020-12-22 12:52:42.917562"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.920127"], ["updated_at", "2020-12-22 12:52:42.920127"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:52:42.923708"], ["updated_at", "2020-12-22 12:52:42.923708"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.926755"], ["updated_at", "2020-12-22 12:52:42.926755"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.929837"], ["updated_at", "2020-12-22 12:52:42.929837"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.932930"], ["updated_at", "2020-12-22 12:52:42.932930"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.943129"], ["updated_at", "2020-12-22 12:52:42.943129"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.945327"], ["updated_at", "2020-12-22 12:52:42.945327"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.947423"], ["updated_at", "2020-12-22 12:52:42.947423"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:42.949196"], ["updated_at", "2020-12-22 12:52:42.949196"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:52:42.953228"], ["updated_at", "2020-12-22 12:52:42.953228"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608727962"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.956216"], ["updated_at", "2020-12-22 12:52:42.956216"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:52:42.961008"], ["updated_at", "2020-12-22 12:52:42.961008"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608555162"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.964120"], ["updated_at", "2020-12-22 12:52:42.964120"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 315], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 12:52:42.984103"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 315]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.992002"], ["updated_at", "2020-12-22 12:52:42.992002"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:42.998019"], ["updated_at", "2020-12-22 12:52:42.998019"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:43.010105"], ["updated_at", "2020-12-22 12:52:43.010105"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:43.015256"], ["updated_at", "2020-12-22 12:52:43.015256"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:43.018432"], ["updated_at", "2020-12-22 12:52:43.018432"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:52:43.023931"], ["updated_at", "2020-12-22 12:52:43.023931"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:52:43.027919"], ["updated_at", "2020-12-22 12:52:43.027919"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:52:43.053228"], ["updated_at", "2020-12-22 12:52:43.053228"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) 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]] SQL (0.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", "2020-12-22 12:52:43.060919"], ["updated_at", "2020-12-22 12:52:43.060919"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) 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", 320], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 320], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:52:43.067439"], ["id", 320]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 320], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.104443"], ["updated_at", "2020-12-22 12:54:09.104443"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.124262"], ["updated_at", "2020-12-22 12:54:09.124262"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.143298"], ["updated_at", "2020-12-22 12:54:09.143298"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.151591"], ["updated_at", "2020-12-22 12:54:09.151591"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.159665"], ["updated_at", "2020-12-22 12:54:09.159665"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.172145"], ["updated_at", "2020-12-22 12:54:09.172145"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (3.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]] SQL (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", "2020-12-22 12:54:09.221642"], ["updated_at", "2020-12-22 12:54:09.221642"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 321], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 321], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.234050"], ["id", 321]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 321], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.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", "2020-12-22 12:54:09.239901"], ["updated_at", "2020-12-22 12:54:09.239901"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.244765"], ["updated_at", "2020-12-22 12:54:09.244765"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.253942"], ["updated_at", "2020-12-22 12:54:09.253942"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.256116"], ["updated_at", "2020-12-22 12:54:09.256116"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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]] SQL (2.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.259100"], ["updated_at", "2020-12-22 12:54:09.259100"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.264449"], ["updated_at", "2020-12-22 12:54:09.264449"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) 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]] SQL (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.275705"], ["updated_at", "2020-12-22 12:54:09.275705"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:54:09.343254"], ["updated_at", "2020-12-22 12:54:09.343254"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728049"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.347067"], ["updated_at", "2020-12-22 12:54:09.347067"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:54:09.351172"], ["updated_at", "2020-12-22 12:54:09.351172"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608555249"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.354550"], ["updated_at", "2020-12-22 12:54:09.354550"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 329], ["host", "example.test"], ["LIMIT", 1]] SQL (0.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 12:54:09.386434"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 329]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.391123"], ["updated_at", "2020-12-22 12:54:09.391123"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.395595"], ["updated_at", "2020-12-22 12:54:09.395595"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.398589"], ["updated_at", "2020-12-22 12:54:09.398589"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.403672"], ["updated_at", "2020-12-22 12:54:09.403672"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.406841"], ["updated_at", "2020-12-22 12:54:09.406841"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.412798"], ["updated_at", "2020-12-22 12:54:09.412798"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.415091"], ["updated_at", "2020-12-22 12:54:09.415091"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:54:09.418839"], ["updated_at", "2020-12-22 12:54:09.418839"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:54:09.423836"], ["updated_at", "2020-12-22 12:54:09.423836"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 12:54:09.426081"], ["updated_at", "2020-12-22 12:54:09.426081"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:54:09.431389"], ["updated_at", "2020-12-22 12:54:09.431389"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.433474"], ["updated_at", "2020-12-22 12:54:09.433474"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:54:09.440651"], ["updated_at", "2020-12-22 12:54:09.440651"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.442890"], ["updated_at", "2020-12-22 12:54:09.442890"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.447054"], ["updated_at", "2020-12-22 12:54:09.447054"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.449123"], ["updated_at", "2020-12-22 12:54:09.449123"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 341], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.452088"], ["id", 341]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.455706"], ["updated_at", "2020-12-22 12:54:09.455706"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.457808"], ["updated_at", "2020-12-22 12:54:09.457808"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_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", 343], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.461650"], ["id", 343]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 343], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.465785"], ["updated_at", "2020-12-22 12:54:09.465785"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.467833"], ["updated_at", "2020-12-22 12:54:09.467833"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 345], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.470761"], ["id", 345]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 345], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.475115"], ["updated_at", "2020-12-22 12:54:09.475115"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.478017"], ["updated_at", "2020-12-22 12:54:09.478017"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.481664"], ["updated_at", "2020-12-22 12:54:09.481664"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.486169"], ["updated_at", "2020-12-22 12:54:09.486169"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:54:09.573306"], ["updated_at", "2020-12-22 12:54:09.573306"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.589881"], ["updated_at", "2020-12-22 12:54:09.589881"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.592773"], ["updated_at", "2020-12-22 12:54:09.592773"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:54:09.599376"], ["updated_at", "2020-12-22 12:54:09.599376"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:54:09.601437"], ["updated_at", "2020-12-22 12:54:09.601437"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:54:09.603457"], ["updated_at", "2020-12-22 12:54:09.603457"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:54:09.607571"], ["updated_at", "2020-12-22 12:54:09.607571"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.613305"], ["updated_at", "2020-12-22 12:54:09.613305"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 373], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 373], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 12:54:09.616350"], ["id", 373]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 373], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 12:54:09.625308"], ["updated_at", "2020-12-22 12:54:09.625308"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 12:54:09.626952"], ["synced_id", 0], ["id", 374]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:54:09.634374"], ["updated_at", "2020-12-22 12:54:09.634374"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:54:09.637743"], ["updated_at", "2020-12-22 12:54:09.637743"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:54:09.654545"], ["updated_at", "2020-12-22 12:54:09.654545"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.659242"], ["updated_at", "2020-12-22 12:54:09.659242"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.662985"], ["updated_at", "2020-12-22 12:54:09.662985"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.666456"], ["updated_at", "2020-12-22 12:54:09.666456"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.669320"], ["updated_at", "2020-12-22 12:54:09.669320"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.672291"], ["updated_at", "2020-12-22 12:54:09.672291"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.674673"], ["updated_at", "2020-12-22 12:54:09.674673"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.678407"], ["updated_at", "2020-12-22 12:54:09.678407"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.680883"], ["updated_at", "2020-12-22 12:54:09.680883"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.683876"], ["updated_at", "2020-12-22 12:54:09.683876"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.685711"], ["updated_at", "2020-12-22 12:54:09.685711"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 387], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.688157"], ["id", 387]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.691743"], ["updated_at", "2020-12-22 12:54:09.691743"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.694365"], ["updated_at", "2020-12-22 12:54:09.694365"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 389], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.696952"], ["id", 389]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 389], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.700773"], ["updated_at", "2020-12-22 12:54:09.700773"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.702755"], ["updated_at", "2020-12-22 12:54:09.702755"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 391], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.705266"], ["id", 391]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 391], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.709657"], ["updated_at", "2020-12-22 12:54:09.709657"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:54:09.712518"], ["updated_at", "2020-12-22 12:54:09.712518"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 393], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.715636"], ["id", 393]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.719291"], ["updated_at", "2020-12-22 12:54:09.719291"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608555249"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 394], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 12:54:09.734905"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 394]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.738492"], ["updated_at", "2020-12-22 12:54:09.738492"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728049"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.741502"], ["updated_at", "2020-12-22 12:54:09.741502"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.748020"], ["updated_at", "2020-12-22 12:54:09.748020"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 9ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.759180"], ["updated_at", "2020-12-22 12:54:09.759180"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:54:09.769036"], ["updated_at", "2020-12-22 12:54:09.769036"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:54:09.776979"], ["updated_at", "2020-12-22 12:54:09.776979"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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: 3.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:54:09.824957"], ["updated_at", "2020-12-22 12:54:09.824957"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (3.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.191122"], ["updated_at", "2020-12-22 12:57:00.191122"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.467024"], ["updated_at", "2020-12-22 12:57:00.467024"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.474757"], ["updated_at", "2020-12-22 12:57:00.474757"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.487834"], ["updated_at", "2020-12-22 12:57:00.487834"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.495254"], ["updated_at", "2020-12-22 12:57:00.495254"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.518432"], ["updated_at", "2020-12-22 12:57:00.518432"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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 13ms (Views: 12.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 7ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:57:00.610088"], ["updated_at", "2020-12-22 12:57:00.610088"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.host"], ["LIMIT", 1]] SQL (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:00.638942"], ["updated_at", "2020-12-22 12:57:00.638942"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:00.643071"], ["updated_at", "2020-12-22 12:57:00.643071"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:00.658297"], ["updated_at", "2020-12-22 12:57:00.658297"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.666321"], ["updated_at", "2020-12-22 12:57:00.666321"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:57:00.677802"], ["updated_at", "2020-12-22 12:57:00.677802"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:00.696737"], ["updated_at", "2020-12-22 12:57:00.696737"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:00.699741"], ["updated_at", "2020-12-22 12:57:00.699741"], ["synced_id", 2], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:00.703034"], ["updated_at", "2020-12-22 12:57:00.703034"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:00.705853"], ["updated_at", "2020-12-22 12:57:00.705853"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.711609"], ["updated_at", "2020-12-22 12:57:00.711609"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.714304"], ["updated_at", "2020-12-22 12:57:00.714304"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.725401"], ["updated_at", "2020-12-22 12:57:00.725401"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.729209"], ["updated_at", "2020-12-22 12:57:00.729209"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 363], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:00.735050"], ["id", 363]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.742780"], ["updated_at", "2020-12-22 12:57:00.742780"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 12:57:00.746490"], ["updated_at", "2020-12-22 12:57:00.746490"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 365], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:00.752906"], ["id", 365]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 365], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.759419"], ["updated_at", "2020-12-22 12:57:00.759419"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.762642"], ["updated_at", "2020-12-22 12:57:00.762642"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) 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.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 367], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:00.769815"], ["id", 367]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 367], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.791058"], ["updated_at", "2020-12-22 12:57:00.791058"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.793237"], ["updated_at", "2020-12-22 12:57:00.793237"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:57:00.797464"], ["updated_at", "2020-12-22 12:57:00.797464"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:57:00.802013"], ["updated_at", "2020-12-22 12:57:00.802013"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.803927"], ["updated_at", "2020-12-22 12:57:00.803927"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:57:00.808058"], ["updated_at", "2020-12-22 12:57:00.808058"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.809940"], ["updated_at", "2020-12-22 12:57:00.809940"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:57:00.814669"], ["updated_at", "2020-12-22 12:57:00.814669"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.817236"], ["updated_at", "2020-12-22 12:57:00.817236"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:57:00.827687"], ["updated_at", "2020-12-22 12:57:00.827687"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608555420"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.834240"], ["updated_at", "2020-12-22 12:57:00.834240"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 378], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:00.872728"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 378]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:57:00.877049"], ["updated_at", "2020-12-22 12:57:00.877049"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728220"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.880699"], ["updated_at", "2020-12-22 12:57:00.880699"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:00.886915"], ["updated_at", "2020-12-22 12:57:00.886915"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.890227"], ["updated_at", "2020-12-22 12:57:00.890227"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.910153"], ["updated_at", "2020-12-22 12:57:00.910153"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:00.938034"], ["updated_at", "2020-12-22 12:57:00.938034"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.940988"], ["updated_at", "2020-12-22 12:57:00.940988"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.943617"], ["updated_at", "2020-12-22 12:57:00.943617"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:00.947046"], ["updated_at", "2020-12-22 12:57:00.947046"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:57:00.956190"], ["updated_at", "2020-12-22 12:57:00.956190"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 383], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 383], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:00.959793"], ["id", 383]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 383], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:00.975867"], ["updated_at", "2020-12-22 12:57:00.975867"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 1.3ms)  (2.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 12:57:00.992057"], ["updated_at", "2020-12-22 12:57:00.992057"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 2.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:00.999876"], ["updated_at", "2020-12-22 12:57:00.999876"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 12:57:01.008238"], ["updated_at", "2020-12-22 12:57:01.008238"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 2.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 12:57:01.040131"], ["updated_at", "2020-12-22 12:57:01.040131"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:57:01.045049"], ["updated_at", "2020-12-22 12:57:01.045049"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.049083"], ["updated_at", "2020-12-22 12:57:01.049083"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 405], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 405], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 12:57:01.052778"], ["id", 405]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 405], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.056359"], ["updated_at", "2020-12-22 12:57:01.056359"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:57:01.059599"], ["updated_at", "2020-12-22 12:57:01.059599"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:57:01.061440"], ["updated_at", "2020-12-22 12:57:01.061440"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:57:01.063122"], ["updated_at", "2020-12-22 12:57:01.063122"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.067400"], ["updated_at", "2020-12-22 12:57:01.067400"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608555421"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 410], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 12:57:01.083712"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 410]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.086804"], ["updated_at", "2020-12-22 12:57:01.086804"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728221"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.089785"], ["updated_at", "2020-12-22 12:57:01.089785"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.093245"], ["updated_at", "2020-12-22 12:57:01.093245"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.096884"], ["updated_at", "2020-12-22 12:57:01.096884"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.100065"], ["updated_at", "2020-12-22 12:57:01.100065"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.103260"], ["updated_at", "2020-12-22 12:57:01.103260"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.105610"], ["updated_at", "2020-12-22 12:57:01.105610"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.108417"], ["updated_at", "2020-12-22 12:57:01.108417"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.110667"], ["updated_at", "2020-12-22 12:57:01.110667"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.113722"], ["updated_at", "2020-12-22 12:57:01.113722"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.116747"], ["updated_at", "2020-12-22 12:57:01.116747"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 421], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.120210"], ["id", 421]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.124192"], ["updated_at", "2020-12-22 12:57:01.124192"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.126028"], ["updated_at", "2020-12-22 12:57:01.126028"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 423], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.128455"], ["id", 423]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.132318"], ["updated_at", "2020-12-22 12:57:01.132318"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.135093"], ["updated_at", "2020-12-22 12:57:01.135093"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 425], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.138264"], ["id", 425]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 425], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.142259"], ["updated_at", "2020-12-22 12:57:01.142259"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 12:57:01.144017"], ["updated_at", "2020-12-22 12:57:01.144017"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 427], ["LIMIT", 1]] SQL (0.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", "2020-12-22 12:57:01.147022"], ["id", 427]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 427], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:57:01.151984"], ["updated_at", "2020-12-22 12:57:01.151984"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 12:57:01.159862"], ["updated_at", "2020-12-22 12:57:01.159862"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 12:57:01.161588"], ["synced_id", 0], ["id", 429]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:57:01.167673"], ["updated_at", "2020-12-22 12:57:01.167673"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 12:57:01.187218"], ["updated_at", "2020-12-22 12:57:01.187218"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 26ms (Views: 25.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 5ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (4.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:02:14.579897"], ["updated_at", "2020-12-22 13:02:14.579897"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 79ms (ActiveRecord: 21.6ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 13:02:14.587492"], ["updated_at", "2020-12-22 13:02:14.587492"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:14.599958"], ["updated_at", "2020-12-22 13:02:14.599958"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (3.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:02:14.627477"], ["updated_at", "2020-12-22 13:02:14.627477"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 3.2ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) 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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "test.example"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:14.638508"], ["updated_at", "2020-12-22 13:02:14.638508"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.654774"], ["updated_at", "2020-12-22 13:02:14.654774"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.659655"], ["updated_at", "2020-12-22 13:02:14.659655"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "test.example"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:14.667737"], ["updated_at", "2020-12-22 13:02:14.667737"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.671182"], ["updated_at", "2020-12-22 13:02:14.671182"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.709365"], ["updated_at", "2020-12-22 13:02:14.709365"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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]] SQL (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", "2020-12-22 13:02:14.713073"], ["updated_at", "2020-12-22 13:02:14.713073"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.720745"], ["updated_at", "2020-12-22 13:02:14.720745"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.723314"], ["updated_at", "2020-12-22 13:02:14.723314"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:02:14.728101"], ["updated_at", "2020-12-22 13:02:14.728101"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:02:14.733166"], ["updated_at", "2020-12-22 13:02:14.733166"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.735291"], ["updated_at", "2020-12-22 13:02:14.735291"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:02:14.741100"], ["updated_at", "2020-12-22 13:02:14.741100"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.743521"], ["updated_at", "2020-12-22 13:02:14.743521"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:02:14.750728"], ["updated_at", "2020-12-22 13:02:14.750728"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.753449"], ["updated_at", "2020-12-22 13:02:14.753449"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.759336"], ["updated_at", "2020-12-22 13:02:14.759336"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.761672"], ["updated_at", "2020-12-22 13:02:14.761672"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 399], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:14.764776"], ["id", 399]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.768846"], ["updated_at", "2020-12-22 13:02:14.768846"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.770920"], ["updated_at", "2020-12-22 13:02:14.770920"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) 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", 401], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:14.775499"], ["id", 401]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 401], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.782479"], ["updated_at", "2020-12-22 13:02:14.782479"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.784908"], ["updated_at", "2020-12-22 13:02:14.784908"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 403], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:14.787919"], ["id", 403]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 403], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:02:14.797450"], ["updated_at", "2020-12-22 13:02:14.797450"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) 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.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.809011"], ["updated_at", "2020-12-22 13:02:14.809011"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.839646"], ["updated_at", "2020-12-22 13:02:14.839646"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:02:14.858852"], ["updated_at", "2020-12-22 13:02:14.858852"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728534"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.862114"], ["updated_at", "2020-12-22 13:02:14.862114"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:02:14.866762"], ["updated_at", "2020-12-22 13:02:14.866762"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608555734"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.870413"], ["updated_at", "2020-12-22 13:02:14.870413"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 408], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:14.891290"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 408]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:14.894867"], ["updated_at", "2020-12-22 13:02:14.894867"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.898300"], ["updated_at", "2020-12-22 13:02:14.898300"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:02:14.902723"], ["updated_at", "2020-12-22 13:02:14.902723"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 410], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 410], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:14.907060"], ["id", 410]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 410], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:14.913432"], ["updated_at", "2020-12-22 13:02:14.913432"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:14.915774"], ["updated_at", "2020-12-22 13:02:14.915774"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:14.917970"], ["updated_at", "2020-12-22 13:02:14.917970"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (2.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:14.920589"], ["updated_at", "2020-12-22 13:02:14.920589"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.951879"], ["updated_at", "2020-12-22 13:02:14.951879"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.964747"], ["updated_at", "2020-12-22 13:02:14.964747"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.975919"], ["updated_at", "2020-12-22 13:02:14.975919"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.984592"], ["updated_at", "2020-12-22 13:02:14.984592"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:14.997966"], ["updated_at", "2020-12-22 13:02:14.997966"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:15.013068"], ["updated_at", "2020-12-22 13:02:15.013068"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:02:15.028336"], ["updated_at", "2020-12-22 13:02:15.028336"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:02:15.029798"], ["synced_id", 0], ["id", 435]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:02:15.035288"], ["updated_at", "2020-12-22 13:02:15.035288"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:02:15.037061"], ["updated_at", "2020-12-22 13:02:15.037061"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:02:15.039105"], ["updated_at", "2020-12-22 13:02:15.039105"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.044333"], ["updated_at", "2020-12-22 13:02:15.044333"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 439], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 439], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.047987"], ["id", 439]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 439], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.053658"], ["updated_at", "2020-12-22 13:02:15.053658"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608555735"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 440], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:02:15.071303"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 440]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.075408"], ["updated_at", "2020-12-22 13:02:15.075408"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728535"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:02:15.078866"], ["updated_at", "2020-12-22 13:02:15.078866"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:02:15.097808"], ["updated_at", "2020-12-22 13:02:15.097808"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:02:15.102050"], ["updated_at", "2020-12-22 13:02:15.102050"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:02:15.108286"], ["updated_at", "2020-12-22 13:02:15.108286"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.112383"], ["updated_at", "2020-12-22 13:02:15.112383"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.114657"], ["updated_at", "2020-12-22 13:02:15.114657"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 447], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.117848"], ["id", 447]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 447], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.124084"], ["updated_at", "2020-12-22 13:02:15.124084"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.126980"], ["updated_at", "2020-12-22 13:02:15.126980"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 449], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.129836"], ["id", 449]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 449], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.134266"], ["updated_at", "2020-12-22 13:02:15.134266"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.136220"], ["updated_at", "2020-12-22 13:02:15.136220"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 451], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.139432"], ["id", 451]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.144557"], ["updated_at", "2020-12-22 13:02:15.144557"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.146651"], ["updated_at", "2020-12-22 13:02:15.146651"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 453], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.150540"], ["id", 453]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.154006"], ["updated_at", "2020-12-22 13:02:15.154006"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.158341"], ["updated_at", "2020-12-22 13:02:15.158341"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.163044"], ["updated_at", "2020-12-22 13:02:15.163044"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.165556"], ["updated_at", "2020-12-22 13:02:15.165556"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.169254"], ["updated_at", "2020-12-22 13:02:15.169254"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.172075"], ["updated_at", "2020-12-22 13:02:15.172075"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.176648"], ["updated_at", "2020-12-22 13:02:15.176648"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) 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.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:02:15.184867"], ["updated_at", "2020-12-22 13:02:15.184867"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:02:15.189921"], ["updated_at", "2020-12-22 13:02:15.189921"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:02:15.196052"], ["updated_at", "2020-12-22 13:02:15.196052"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.201018"], ["updated_at", "2020-12-22 13:02:15.201018"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:02:15.203491"], ["updated_at", "2020-12-22 13:02:15.203491"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:02:15.220522"], ["updated_at", "2020-12-22 13:02:15.220522"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.7ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists (4.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:57.058750"], ["updated_at", "2020-12-22 13:05:57.058750"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (5.3ms) 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.3ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:57.743228"], ["updated_at", "2020-12-22 13:05:57.743228"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:57.752549"], ["updated_at", "2020-12-22 13:05:57.752549"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:57.761883"], ["updated_at", "2020-12-22 13:05:57.761883"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:57.776686"], ["updated_at", "2020-12-22 13:05:57.776686"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.3ms) 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]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:57.814244"], ["updated_at", "2020-12-22 13:05:57.814244"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.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.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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) 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]]  (0.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]] SQL (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", "2020-12-22 13:05:57.971145"], ["updated_at", "2020-12-22 13:05:57.971145"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 25ms (ActiveRecord: 10.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:57.982898"], ["updated_at", "2020-12-22 13:05:57.982898"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 1.3ms)  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:58.006711"], ["updated_at", "2020-12-22 13:05:58.006711"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (4.4ms) 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]]  (0.2ms) 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", "test.host"], ["LIMIT", 1]] SQL (3.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", "2020-12-22 13:05:58.087619"], ["updated_at", "2020-12-22 13:05:58.087619"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 55ms (ActiveRecord: 13.4ms)  (0.3ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (1.5ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 47ms (Views: 25.8ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.8ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms | ActiveRecord: 0.0ms)  (1.7ms) ROLLBACK  (0.6ms) BEGIN  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (8.6ms) ROLLBACK  (1.9ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (2.6ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (7.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]] SQL (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", "2020-12-22 13:05:58.233865"], ["updated_at", "2020-12-22 13:05:58.233865"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.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]] SQL (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", "2020-12-22 13:05:58.246085"], ["updated_at", "2020-12-22 13:05:58.246085"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 13:05:58.260058"], ["updated_at", "2020-12-22 13:05:58.260058"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.266004"], ["updated_at", "2020-12-22 13:05:58.266004"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:05:58.273450"], ["updated_at", "2020-12-22 13:05:58.273450"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:05:58.286479"], ["updated_at", "2020-12-22 13:05:58.286479"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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", 456], ["host", "example2.test"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.291733"], ["updated_at", "2020-12-22 13:05:58.291733"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:05:58.299528"], ["updated_at", "2020-12-22 13:05:58.299528"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.305756"], ["updated_at", "2020-12-22 13:05:58.305756"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:05:58.346489"], ["updated_at", "2020-12-22 13:05:58.346489"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.357934"], ["updated_at", "2020-12-22 13:05:58.357934"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.363940"], ["updated_at", "2020-12-22 13:05:58.363940"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:05:58.368801"], ["updated_at", "2020-12-22 13:05:58.368801"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) 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"."id" != $2) AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 429], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 13:05:58.378232"], ["id", 429]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.384956"], ["updated_at", "2020-12-22 13:05:58.384956"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.388120"], ["updated_at", "2020-12-22 13:05:58.388120"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.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]]  (0.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", 431], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:58.407382"], ["id", 431]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 431], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.416814"], ["updated_at", "2020-12-22 13:05:58.416814"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.421761"], ["updated_at", "2020-12-22 13:05:58.421761"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.8ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 433], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:58.431564"], ["id", 433]]  (0.1ms) 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", 433], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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", "test.example"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.448955"], ["updated_at", "2020-12-22 13:05:58.448955"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.455699"], ["updated_at", "2020-12-22 13:05:58.455699"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (1.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.463665"], ["updated_at", "2020-12-22 13:05:58.463665"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.475180"], ["updated_at", "2020-12-22 13:05:58.475180"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.481748"], ["updated_at", "2020-12-22 13:05:58.481748"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:05:58.495726"], ["updated_at", "2020-12-22 13:05:58.495726"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.506083"], ["updated_at", "2020-12-22 13:05:58.506083"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) 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.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.513519"], ["updated_at", "2020-12-22 13:05:58.513519"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.577305"], ["updated_at", "2020-12-22 13:05:58.577305"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.585905"], ["updated_at", "2020-12-22 13:05:58.585905"], ["synced_id", 2], ["host", "example.test"]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.595381"], ["updated_at", "2020-12-22 13:05:58.595381"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.599171"], ["updated_at", "2020-12-22 13:05:58.599171"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:05:58.607894"], ["updated_at", "2020-12-22 13:05:58.607894"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608555958"], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (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 (0.4ms) 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]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.620320"], ["updated_at", "2020-12-22 13:05:58.620320"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 443], ["host", "example.test"], ["LIMIT", 1]] SQL (0.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:05:58.654795"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 443]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:05:58.660161"], ["updated_at", "2020-12-22 13:05:58.660161"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728758"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.665370"], ["updated_at", "2020-12-22 13:05:58.665370"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) 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.3ms) ROLLBACK  (1.0ms) BEGIN  (0.2ms) 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]] SQL (0.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", "2020-12-22 13:05:58.679640"], ["updated_at", "2020-12-22 13:05:58.679640"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 445], ["LIMIT", 1]]  (0.1ms) 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"."id" != $1) AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 445], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:58.685258"], ["id", 445]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 445], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.4ms) 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]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.697000"], ["updated_at", "2020-12-22 13:05:58.697000"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.test"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.743707"], ["updated_at", "2020-12-22 13:05:58.743707"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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 (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:05:58.759634"], ["updated_at", "2020-12-22 13:05:58.759634"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.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 5ms (Views: 4.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) 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]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:05:58.895291"], ["updated_at", "2020-12-22 13:05:58.895291"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (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", "2020-12-22 13:05:58.901155"], ["updated_at", "2020-12-22 13:05:58.901155"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:05:58.906784"], ["updated_at", "2020-12-22 13:05:58.906784"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:05:58.910819"], ["updated_at", "2020-12-22 13:05:58.910819"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:05:58.913700"], ["updated_at", "2020-12-22 13:05:58.913700"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:58.920691"], ["updated_at", "2020-12-22 13:05:58.920691"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 472], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 472], ["LIMIT", 1]] SQL (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", "2020-12-22 13:05:58.927907"], ["id", 472]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 472], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.937843"], ["updated_at", "2020-12-22 13:05:58.937843"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.944742"], ["updated_at", "2020-12-22 13:05:58.944742"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 474], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:58.950655"], ["id", 474]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.956829"], ["updated_at", "2020-12-22 13:05:58.956829"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.961587"], ["updated_at", "2020-12-22 13:05:58.961587"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 476], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:58.967284"], ["id", 476]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 476], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.972777"], ["updated_at", "2020-12-22 13:05:58.972777"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.977446"], ["updated_at", "2020-12-22 13:05:58.977446"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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", 478], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:58.982603"], ["id", 478]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 478], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.988516"], ["updated_at", "2020-12-22 13:05:58.988516"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:58.992526"], ["updated_at", "2020-12-22 13:05:58.992526"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 480], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:58.997442"], ["id", 480]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:59.002774"], ["updated_at", "2020-12-22 13:05:59.002774"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:05:59.007580"], ["updated_at", "2020-12-22 13:05:59.007580"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:59.014115"], ["updated_at", "2020-12-22 13:05:59.014115"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:05:59.017338"], ["updated_at", "2020-12-22 13:05:59.017338"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:59.022510"], ["updated_at", "2020-12-22 13:05:59.022510"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:59.026338"], ["updated_at", "2020-12-22 13:05:59.026338"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:59.032588"], ["updated_at", "2020-12-22 13:05:59.032588"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:59.036313"], ["updated_at", "2020-12-22 13:05:59.036313"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:05:59.042287"], ["updated_at", "2020-12-22 13:05:59.042287"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:05:59.070375"], ["updated_at", "2020-12-22 13:05:59.070375"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:05:59.084748"], ["updated_at", "2020-12-22 13:05:59.084748"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:05:59.087767"], ["synced_id", 0], ["id", 491]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:05:59.095069"], ["updated_at", "2020-12-22 13:05:59.095069"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:59.101082"], ["updated_at", "2020-12-22 13:05:59.101082"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608555959"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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", 493], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:05:59.126296"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 493]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:05:59.131578"], ["updated_at", "2020-12-22 13:05:59.131578"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728759"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:05:59.139295"], ["updated_at", "2020-12-22 13:05:59.139295"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:59.147266"], ["updated_at", "2020-12-22 13:05:59.147266"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:05:59.149918"], ["updated_at", "2020-12-22 13:05:59.149918"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (4.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:51.855620"], ["updated_at", "2020-12-22 13:06:51.855620"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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", "test.example"], ["LIMIT", 1]] SQL (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.155923"], ["updated_at", "2020-12-22 13:06:52.155923"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.161443"], ["updated_at", "2020-12-22 13:06:52.161443"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.165690"], ["updated_at", "2020-12-22 13:06:52.165690"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.169228"], ["updated_at", "2020-12-22 13:06:52.169228"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:06:52.205612"], ["updated_at", "2020-12-22 13:06:52.205612"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556012"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.208713"], ["updated_at", "2020-12-22 13:06:52.208713"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 451], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:06:52.226789"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 451]]  (7.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:06:52.243106"], ["updated_at", "2020-12-22 13:06:52.243106"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728812"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.246089"], ["updated_at", "2020-12-22 13:06:52.246089"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.249774"], ["updated_at", "2020-12-22 13:06:52.249774"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.251858"], ["updated_at", "2020-12-22 13:06:52.251858"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 453], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.259744"], ["id", 453]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.265372"], ["updated_at", "2020-12-22 13:06:52.265372"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.267314"], ["updated_at", "2020-12-22 13:06:52.267314"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 455], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.270978"], ["id", 455]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 455], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.275807"], ["updated_at", "2020-12-22 13:06:52.275807"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.278154"], ["updated_at", "2020-12-22 13:06:52.278154"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 457], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.280702"], ["id", 457]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 457], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:06:52.285901"], ["updated_at", "2020-12-22 13:06:52.285901"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.288739"], ["updated_at", "2020-12-22 13:06:52.288739"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:06:52.296615"], ["updated_at", "2020-12-22 13:06:52.296615"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.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", 123], ["host", "example3.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.306557"], ["updated_at", "2020-12-22 13:06:52.306557"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.310101"], ["updated_at", "2020-12-22 13:06:52.310101"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:06:52.314849"], ["updated_at", "2020-12-22 13:06:52.314849"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.316952"], ["updated_at", "2020-12-22 13:06:52.316952"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:06:52.321250"], ["updated_at", "2020-12-22 13:06:52.321250"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.323720"], ["updated_at", "2020-12-22 13:06:52.323720"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.330189"], ["updated_at", "2020-12-22 13:06:52.330189"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.335153"], ["updated_at", "2020-12-22 13:06:52.335153"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.346533"], ["updated_at", "2020-12-22 13:06:52.346533"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.353716"], ["updated_at", "2020-12-22 13:06:52.353716"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.360854"], ["updated_at", "2020-12-22 13:06:52.360854"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) 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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:06:52.367072"], ["updated_at", "2020-12-22 13:06:52.367072"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.379427"], ["updated_at", "2020-12-22 13:06:52.379427"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:06:52.407560"], ["updated_at", "2020-12-22 13:06:52.407560"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 473], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 473], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.412257"], ["id", 473]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 473], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.421646"], ["updated_at", "2020-12-22 13:06:52.421646"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.426152"], ["updated_at", "2020-12-22 13:06:52.426152"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.428681"], ["updated_at", "2020-12-22 13:06:52.428681"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.432752"], ["updated_at", "2020-12-22 13:06:52.432752"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.3ms) BEGIN  (0.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]] SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:06:52.514553"], ["updated_at", "2020-12-22 13:06:52.514553"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.526463"], ["updated_at", "2020-12-22 13:06:52.526463"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.528968"], ["updated_at", "2020-12-22 13:06:52.528968"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.538132"], ["updated_at", "2020-12-22 13:06:52.538132"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.546853"], ["updated_at", "2020-12-22 13:06:52.546853"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.559381"], ["updated_at", "2020-12-22 13:06:52.559381"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.574119"], ["updated_at", "2020-12-22 13:06:52.574119"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.587281"], ["updated_at", "2020-12-22 13:06:52.587281"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.597771"], ["updated_at", "2020-12-22 13:06:52.597771"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.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", "2020-12-22 13:06:52.612631"], ["updated_at", "2020-12-22 13:06:52.612631"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728812"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.616162"], ["updated_at", "2020-12-22 13:06:52.616162"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556012"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 498], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:06:52.632855"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 498]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:06:52.643112"], ["updated_at", "2020-12-22 13:06:52.643112"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:06:52.644538"], ["synced_id", 0], ["id", 499]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:06:52.649688"], ["updated_at", "2020-12-22 13:06:52.649688"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.652697"], ["updated_at", "2020-12-22 13:06:52.652697"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 501], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 501], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 13:06:52.656071"], ["id", 501]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 501], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:06:52.660748"], ["updated_at", "2020-12-22 13:06:52.660748"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:06:52.664351"], ["updated_at", "2020-12-22 13:06:52.664351"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:06:52.682200"], ["updated_at", "2020-12-22 13:06:52.682200"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.685676"], ["updated_at", "2020-12-22 13:06:52.685676"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.689339"], ["updated_at", "2020-12-22 13:06:52.689339"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.693209"], ["updated_at", "2020-12-22 13:06:52.693209"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.696135"], ["updated_at", "2020-12-22 13:06:52.696135"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.699889"], ["updated_at", "2020-12-22 13:06:52.699889"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:06:52.703674"], ["updated_at", "2020-12-22 13:06:52.703674"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.708391"], ["updated_at", "2020-12-22 13:06:52.708391"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.712367"], ["updated_at", "2020-12-22 13:06:52.712367"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.716825"], ["updated_at", "2020-12-22 13:06:52.716825"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.720476"], ["updated_at", "2020-12-22 13:06:52.720476"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 514], ["LIMIT", 1]] SQL (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", "2020-12-22 13:06:52.725095"], ["id", 514]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.730258"], ["updated_at", "2020-12-22 13:06:52.730258"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.732138"], ["updated_at", "2020-12-22 13:06:52.732138"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 516], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.734950"], ["id", 516]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.738661"], ["updated_at", "2020-12-22 13:06:52.738661"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.741820"], ["updated_at", "2020-12-22 13:06:52.741820"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 518], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.744893"], ["id", 518]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 518], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.749091"], ["updated_at", "2020-12-22 13:06:52.749091"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:06:52.751096"], ["updated_at", "2020-12-22 13:06:52.751096"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 520], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.754039"], ["id", 520]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 520], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.758623"], ["updated_at", "2020-12-22 13:06:52.758623"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:06:52.762325"], ["updated_at", "2020-12-22 13:06:52.762325"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:06:52.764025"], ["updated_at", "2020-12-22 13:06:52.764025"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:06:52.766315"], ["updated_at", "2020-12-22 13:06:52.766315"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:06:52.771803"], ["updated_at", "2020-12-22 13:06:52.771803"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.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 6ms (Views: 5.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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 5ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 3.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.829377"], ["updated_at", "2020-12-22 13:06:52.829377"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.836428"], ["updated_at", "2020-12-22 13:06:52.836428"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 1.4ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:06:52.846141"], ["updated_at", "2020-12-22 13:06:52.846141"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:06:52.856595"], ["updated_at", "2020-12-22 13:06:52.856595"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.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 20ms (Views: 9.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN 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]]  (0.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]] SQL (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", "2020-12-22 13:07:05.740914"], ["updated_at", "2020-12-22 13:07:05.740914"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 80ms (ActiveRecord: 20.4ms)  (0.1ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:05.754301"], ["updated_at", "2020-12-22 13:07:05.754301"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:05.769796"], ["updated_at", "2020-12-22 13:07:05.769796"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 1.2ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (3.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:07:05.817341"], ["updated_at", "2020-12-22 13:07:05.817341"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 31ms (ActiveRecord: 3.5ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 5.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:05.900299"], ["updated_at", "2020-12-22 13:07:05.900299"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556025"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 531], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:07:05.931490"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 531]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:05.935022"], ["updated_at", "2020-12-22 13:07:05.935022"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728825"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:05.939506"], ["updated_at", "2020-12-22 13:07:05.939506"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:05.963716"], ["updated_at", "2020-12-22 13:07:05.963716"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:05.968217"], ["updated_at", "2020-12-22 13:07:05.968217"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:05.972468"], ["updated_at", "2020-12-22 13:07:05.972468"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:05.976438"], ["updated_at", "2020-12-22 13:07:05.976438"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:05.980750"], ["updated_at", "2020-12-22 13:07:05.980750"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:05.984348"], ["updated_at", "2020-12-22 13:07:05.984348"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:05.987044"], ["updated_at", "2020-12-22 13:07:05.987044"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:05.991251"], ["updated_at", "2020-12-22 13:07:05.991251"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:05.994044"], ["updated_at", "2020-12-22 13:07:05.994044"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:05.997598"], ["updated_at", "2020-12-22 13:07:05.997598"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:05.999794"], ["updated_at", "2020-12-22 13:07:05.999794"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 544], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:06.002912"], ["id", 544]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.006935"], ["updated_at", "2020-12-22 13:07:06.006935"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.008895"], ["updated_at", "2020-12-22 13:07:06.008895"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 546], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:06.011826"], ["id", 546]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.015864"], ["updated_at", "2020-12-22 13:07:06.015864"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.017852"], ["updated_at", "2020-12-22 13:07:06.017852"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 548], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:06.020730"], ["id", 548]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 548], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.025829"], ["updated_at", "2020-12-22 13:07:06.025829"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.027722"], ["updated_at", "2020-12-22 13:07:06.027722"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 550], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:06.030573"], ["id", 550]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 550], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:06.034635"], ["updated_at", "2020-12-22 13:07:06.034635"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 551], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 551], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:06.041619"], ["id", 551]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 551], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:06.046054"], ["updated_at", "2020-12-22 13:07:06.046054"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:06.049634"], ["updated_at", "2020-12-22 13:07:06.049634"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:06.052877"], ["updated_at", "2020-12-22 13:07:06.052877"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:06.055431"], ["updated_at", "2020-12-22 13:07:06.055431"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:06.058086"], ["updated_at", "2020-12-22 13:07:06.058086"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:07:06.080099"], ["updated_at", "2020-12-22 13:07:06.080099"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:07:06.082551"], ["synced_id", 0], ["id", 557]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:06.095444"], ["updated_at", "2020-12-22 13:07:06.095444"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "test.example"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.108815"], ["updated_at", "2020-12-22 13:07:06.108815"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.125172"], ["updated_at", "2020-12-22 13:07:06.125172"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.130480"], ["updated_at", "2020-12-22 13:07:06.130480"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:06.135878"], ["updated_at", "2020-12-22 13:07:06.135878"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:07:06.141536"], ["updated_at", "2020-12-22 13:07:06.141536"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 484], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 484], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:06.144999"], ["id", 484]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 484], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:06.149356"], ["updated_at", "2020-12-22 13:07:06.149356"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556026"], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.154328"], ["updated_at", "2020-12-22 13:07:06.154328"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 485], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:06.172207"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 485]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:06.176080"], ["updated_at", "2020-12-22 13:07:06.176080"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728826"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.179749"], ["updated_at", "2020-12-22 13:07:06.179749"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.184852"], ["updated_at", "2020-12-22 13:07:06.184852"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.189513"], ["updated_at", "2020-12-22 13:07:06.189513"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.194290"], ["updated_at", "2020-12-22 13:07:06.194290"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:07:06.203301"], ["updated_at", "2020-12-22 13:07:06.203301"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.205841"], ["updated_at", "2020-12-22 13:07:06.205841"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:06.209024"], ["updated_at", "2020-12-22 13:07:06.209024"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:06.213667"], ["updated_at", "2020-12-22 13:07:06.213667"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.215676"], ["updated_at", "2020-12-22 13:07:06.215676"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:06.220032"], ["updated_at", "2020-12-22 13:07:06.220032"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.222819"], ["updated_at", "2020-12-22 13:07:06.222819"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:06.226723"], ["updated_at", "2020-12-22 13:07:06.226723"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.228884"], ["updated_at", "2020-12-22 13:07:06.228884"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.232192"], ["updated_at", "2020-12-22 13:07:06.232192"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.234355"], ["updated_at", "2020-12-22 13:07:06.234355"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 498], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:06.237597"], ["id", 498]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.241407"], ["updated_at", "2020-12-22 13:07:06.241407"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.243444"], ["updated_at", "2020-12-22 13:07:06.243444"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 500], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 13:07:06.253855"], ["id", 500]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 500], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.260070"], ["updated_at", "2020-12-22 13:07:06.260070"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.262844"], ["updated_at", "2020-12-22 13:07:06.262844"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 502], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:06.265676"], ["id", 502]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 502], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.270424"], ["updated_at", "2020-12-22 13:07:06.270424"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.272953"], ["updated_at", "2020-12-22 13:07:06.272953"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.278745"], ["updated_at", "2020-12-22 13:07:06.278745"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.282131"], ["updated_at", "2020-12-22 13:07:06.282131"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.302435"], ["updated_at", "2020-12-22 13:07:06.302435"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.305982"], ["updated_at", "2020-12-22 13:07:06.305982"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.307962"], ["updated_at", "2020-12-22 13:07:06.307962"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.310155"], ["updated_at", "2020-12-22 13:07:06.310155"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.316507"], ["updated_at", "2020-12-22 13:07:06.316507"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:06.323770"], ["updated_at", "2020-12-22 13:07:06.323770"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.329448"], ["updated_at", "2020-12-22 13:07:06.329448"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:06.332003"], ["updated_at", "2020-12-22 13:07:06.332003"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.346977"], ["updated_at", "2020-12-22 13:07:06.346977"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.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 Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.365801"], ["updated_at", "2020-12-22 13:07:06.365801"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.376014"], ["updated_at", "2020-12-22 13:07:06.376014"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (3.2ms) SAVEPOINT active_record_1 Application Exists (0.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 (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.398828"], ["updated_at", "2020-12-22 13:07:06.398828"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) 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.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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.420461"], ["updated_at", "2020-12-22 13:07:06.420461"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.436088"], ["updated_at", "2020-12-22 13:07:06.436088"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:06.445665"], ["updated_at", "2020-12-22 13:07:06.445665"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (7.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]] SQL (5.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", "2020-12-22 13:07:30.350192"], ["updated_at", "2020-12-22 13:07:30.350192"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:07:30.376067"], ["updated_at", "2020-12-22 13:07:30.376067"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728850"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (4.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 (2.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.387886"], ["updated_at", "2020-12-22 13:07:30.387886"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:07:30.399835"], ["updated_at", "2020-12-22 13:07:30.399835"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556050"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.405602"], ["updated_at", "2020-12-22 13:07:30.405602"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 515], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:07:30.437881"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 515]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.442048"], ["updated_at", "2020-12-22 13:07:30.442048"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.445376"], ["updated_at", "2020-12-22 13:07:30.445376"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) 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]] SQL (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.461339"], ["updated_at", "2020-12-22 13:07:30.461339"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:07:30.466943"], ["updated_at", "2020-12-22 13:07:30.466943"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.470895"], ["updated_at", "2020-12-22 13:07:30.470895"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 517], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:30.478743"], ["id", 517]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.484194"], ["updated_at", "2020-12-22 13:07:30.484194"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.486840"], ["updated_at", "2020-12-22 13:07:30.486840"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:30.489922"], ["id", 519]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 519], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.494148"], ["updated_at", "2020-12-22 13:07:30.494148"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.496074"], ["updated_at", "2020-12-22 13:07:30.496074"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 521], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:30.499031"], ["id", 521]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 521], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.504437"], ["updated_at", "2020-12-22 13:07:30.504437"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.506639"], ["updated_at", "2020-12-22 13:07:30.506639"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:30.510666"], ["updated_at", "2020-12-22 13:07:30.510666"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:30.515144"], ["updated_at", "2020-12-22 13:07:30.515144"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.517322"], ["updated_at", "2020-12-22 13:07:30.517322"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:30.522094"], ["updated_at", "2020-12-22 13:07:30.522094"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.524019"], ["updated_at", "2020-12-22 13:07:30.524019"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:30.527429"], ["updated_at", "2020-12-22 13:07:30.527429"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.529258"], ["updated_at", "2020-12-22 13:07:30.529258"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.532560"], ["updated_at", "2020-12-22 13:07:30.532560"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.536094"], ["updated_at", "2020-12-22 13:07:30.536094"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:30.540060"], ["updated_at", "2020-12-22 13:07:30.540060"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 534], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 534], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:30.542715"], ["id", 534]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 534], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.552205"], ["updated_at", "2020-12-22 13:07:30.552205"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.595238"], ["updated_at", "2020-12-22 13:07:30.595238"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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 (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.625335"], ["updated_at", "2020-12-22 13:07:30.625335"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.631918"], ["updated_at", "2020-12-22 13:07:30.631918"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.655198"], ["updated_at", "2020-12-22 13:07:30.655198"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.659830"], ["updated_at", "2020-12-22 13:07:30.659830"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.665825"], ["updated_at", "2020-12-22 13:07:30.665825"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.670112"], ["updated_at", "2020-12-22 13:07:30.670112"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.673690"], ["updated_at", "2020-12-22 13:07:30.673690"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.678204"], ["updated_at", "2020-12-22 13:07:30.678204"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 19ms (Views: 17.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) 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]]  (0.1ms) 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]] SQL (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", "2020-12-22 13:07:30.780160"], ["updated_at", "2020-12-22 13:07:30.780160"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 22ms (ActiveRecord: 6.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:30.792637"], ["updated_at", "2020-12-22 13:07:30.792637"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:30.802747"], ["updated_at", "2020-12-22 13:07:30.802747"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:30.811286"], ["updated_at", "2020-12-22 13:07:30.811286"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.825792"], ["updated_at", "2020-12-22 13:07:30.825792"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.842978"], ["updated_at", "2020-12-22 13:07:30.842978"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.859489"], ["updated_at", "2020-12-22 13:07:30.859489"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) 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.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.873963"], ["updated_at", "2020-12-22 13:07:30.873963"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.882189"], ["updated_at", "2020-12-22 13:07:30.882189"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:30.895627"], ["updated_at", "2020-12-22 13:07:30.895627"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.907704"], ["updated_at", "2020-12-22 13:07:30.907704"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.909836"], ["updated_at", "2020-12-22 13:07:30.909836"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:30.914778"], ["updated_at", "2020-12-22 13:07:30.914778"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 5ms (Views: 4.5ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.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.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:30.949344"], ["updated_at", "2020-12-22 13:07:30.949344"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.953870"], ["updated_at", "2020-12-22 13:07:30.953870"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:30.959608"], ["updated_at", "2020-12-22 13:07:30.959608"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.965341"], ["updated_at", "2020-12-22 13:07:30.965341"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:30.970404"], ["updated_at", "2020-12-22 13:07:30.970404"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.974529"], ["updated_at", "2020-12-22 13:07:30.974529"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:30.978651"], ["updated_at", "2020-12-22 13:07:30.978651"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.982720"], ["updated_at", "2020-12-22 13:07:30.982720"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:30.987019"], ["updated_at", "2020-12-22 13:07:30.987019"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.990793"], ["updated_at", "2020-12-22 13:07:30.990793"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.992645"], ["updated_at", "2020-12-22 13:07:30.992645"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 574], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:30.995031"], ["id", 574]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:30.998245"], ["updated_at", "2020-12-22 13:07:30.998245"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:31.000457"], ["updated_at", "2020-12-22 13:07:31.000457"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) 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", 576], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:31.005993"], ["id", 576]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:31.010336"], ["updated_at", "2020-12-22 13:07:31.010336"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (1.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:31.012797"], ["updated_at", "2020-12-22 13:07:31.012797"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 578], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:31.018337"], ["id", 578]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 578], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:31.023801"], ["updated_at", "2020-12-22 13:07:31.023801"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:31.025618"], ["updated_at", "2020-12-22 13:07:31.025618"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 580], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:31.028015"], ["id", 580]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 580], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:31.031832"], ["updated_at", "2020-12-22 13:07:31.031832"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:31.037309"], ["updated_at", "2020-12-22 13:07:31.037309"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556051"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 582], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:07:31.053652"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 582]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:31.057141"], ["updated_at", "2020-12-22 13:07:31.057141"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728851"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:31.060174"], ["updated_at", "2020-12-22 13:07:31.060174"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:31.061863"], ["updated_at", "2020-12-22 13:07:31.061863"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:31.063895"], ["updated_at", "2020-12-22 13:07:31.063895"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:31.070502"], ["updated_at", "2020-12-22 13:07:31.070502"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:07:31.086431"], ["updated_at", "2020-12-22 13:07:31.086431"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:07:31.088578"], ["synced_id", 0], ["id", 588]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:31.094590"], ["updated_at", "2020-12-22 13:07:31.094590"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:31.120986"], ["updated_at", "2020-12-22 13:07:31.120986"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:31.143234"], ["updated_at", "2020-12-22 13:07:31.143234"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 591], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 591], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 13:07:31.146239"], ["id", 591]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 591], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:31.152469"], ["updated_at", "2020-12-22 13:07:31.152469"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:43.852180"], ["updated_at", "2020-12-22 13:07:43.852180"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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.host"], ["LIMIT", 1]] SQL (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.090041"], ["updated_at", "2020-12-22 13:07:44.090041"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.094832"], ["updated_at", "2020-12-22 13:07:44.094832"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.112644"], ["updated_at", "2020-12-22 13:07:44.112644"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.134703"], ["updated_at", "2020-12-22 13:07:44.134703"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.142605"], ["updated_at", "2020-12-22 13:07:44.142605"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.154562"], ["updated_at", "2020-12-22 13:07:44.154562"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.162259"], ["updated_at", "2020-12-22 13:07:44.162259"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.174594"], ["updated_at", "2020-12-22 13:07:44.174594"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 13:07:44.195773"], ["updated_at", "2020-12-22 13:07:44.195773"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 1.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.203974"], ["updated_at", "2020-12-22 13:07:44.203974"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.213832"], ["updated_at", "2020-12-22 13:07:44.213832"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:44.222034"], ["updated_at", "2020-12-22 13:07:44.222034"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 5.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:44.256869"], ["updated_at", "2020-12-22 13:07:44.256869"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.264377"], ["updated_at", "2020-12-22 13:07:44.264377"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.266399"], ["updated_at", "2020-12-22 13:07:44.266399"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.268661"], ["updated_at", "2020-12-22 13:07:44.268661"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.271015"], ["updated_at", "2020-12-22 13:07:44.271015"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.275220"], ["updated_at", "2020-12-22 13:07:44.275220"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.278945"], ["updated_at", "2020-12-22 13:07:44.278945"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:44.315058"], ["updated_at", "2020-12-22 13:07:44.315058"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728864"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.318114"], ["updated_at", "2020-12-22 13:07:44.318114"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.323292"], ["updated_at", "2020-12-22 13:07:44.323292"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556064"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.327642"], ["updated_at", "2020-12-22 13:07:44.327642"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 555], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:07:44.344148"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 555]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.347770"], ["updated_at", "2020-12-22 13:07:44.347770"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.350060"], ["updated_at", "2020-12-22 13:07:44.350060"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.354091"], ["updated_at", "2020-12-22 13:07:44.354091"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.356206"], ["updated_at", "2020-12-22 13:07:44.356206"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 558], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.359240"], ["id", 558]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.363214"], ["updated_at", "2020-12-22 13:07:44.363214"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.365176"], ["updated_at", "2020-12-22 13:07:44.365176"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 560], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.367889"], ["id", 560]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 560], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.371725"], ["updated_at", "2020-12-22 13:07:44.371725"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.373631"], ["updated_at", "2020-12-22 13:07:44.373631"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 562], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.377252"], ["id", 562]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 562], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.381293"], ["updated_at", "2020-12-22 13:07:44.381293"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.384340"], ["updated_at", "2020-12-22 13:07:44.384340"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:44.387945"], ["updated_at", "2020-12-22 13:07:44.387945"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:07:44.392743"], ["updated_at", "2020-12-22 13:07:44.392743"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.398080"], ["updated_at", "2020-12-22 13:07:44.398080"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:44.403566"], ["updated_at", "2020-12-22 13:07:44.403566"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.406116"], ["updated_at", "2020-12-22 13:07:44.406116"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:44.410595"], ["updated_at", "2020-12-22 13:07:44.410595"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.433538"], ["updated_at", "2020-12-22 13:07:44.433538"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.437195"], ["updated_at", "2020-12-22 13:07:44.437195"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.439994"], ["updated_at", "2020-12-22 13:07:44.439994"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) 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]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.443465"], ["updated_at", "2020-12-22 13:07:44.443465"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.448131"], ["updated_at", "2020-12-22 13:07:44.448131"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:07:44.472667"], ["updated_at", "2020-12-22 13:07:44.472667"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 574], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 574], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.475501"], ["id", 574]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 574], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.480290"], ["updated_at", "2020-12-22 13:07:44.480290"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.483220"], ["updated_at", "2020-12-22 13:07:44.483220"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.486899"], ["updated_at", "2020-12-22 13:07:44.486899"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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 (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:44.500997"], ["updated_at", "2020-12-22 13:07:44.500997"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:44.520933"], ["updated_at", "2020-12-22 13:07:44.520933"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:44.537449"], ["updated_at", "2020-12-22 13:07:44.537449"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.543333"], ["updated_at", "2020-12-22 13:07:44.543333"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:07:44.552244"], ["updated_at", "2020-12-22 13:07:44.552244"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:07:44.553718"], ["synced_id", 0], ["id", 600]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.558872"], ["updated_at", "2020-12-22 13:07:44.558872"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.562687"], ["updated_at", "2020-12-22 13:07:44.562687"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.568159"], ["updated_at", "2020-12-22 13:07:44.568159"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.571478"], ["updated_at", "2020-12-22 13:07:44.571478"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.574816"], ["updated_at", "2020-12-22 13:07:44.574816"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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]] SQL (0.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", "2020-12-22 13:07:44.578667"], ["updated_at", "2020-12-22 13:07:44.578667"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.583135"], ["updated_at", "2020-12-22 13:07:44.583135"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.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.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.589397"], ["updated_at", "2020-12-22 13:07:44.589397"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.594314"], ["updated_at", "2020-12-22 13:07:44.594314"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.596633"], ["updated_at", "2020-12-22 13:07:44.596633"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 610], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.599779"], ["id", 610]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 610], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.605896"], ["updated_at", "2020-12-22 13:07:44.605896"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.608370"], ["updated_at", "2020-12-22 13:07:44.608370"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 612], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.612421"], ["id", 612]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 612], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.616420"], ["updated_at", "2020-12-22 13:07:44.616420"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.618228"], ["updated_at", "2020-12-22 13:07:44.618228"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 614], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.621882"], ["id", 614]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.626083"], ["updated_at", "2020-12-22 13:07:44.626083"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:07:44.628433"], ["updated_at", "2020-12-22 13:07:44.628433"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 616], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.630788"], ["id", 616]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.634866"], ["updated_at", "2020-12-22 13:07:44.634866"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556064"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 617], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:07:44.651183"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 617]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.654485"], ["updated_at", "2020-12-22 13:07:44.654485"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728864"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:44.657385"], ["updated_at", "2020-12-22 13:07:44.657385"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:44.659251"], ["updated_at", "2020-12-22 13:07:44.659251"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:44.661452"], ["updated_at", "2020-12-22 13:07:44.661452"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:07:44.664892"], ["updated_at", "2020-12-22 13:07:44.664892"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:07:44.667833"], ["updated_at", "2020-12-22 13:07:44.667833"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 623], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 623], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 13:07:44.670391"], ["id", 623]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 623], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:07:44.680818"], ["updated_at", "2020-12-22 13:07:44.680818"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.3ms) ROLLBACK  (0.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: 2.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (5.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.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", "2020-12-22 13:08:00.776310"], ["updated_at", "2020-12-22 13:08:00.776310"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 12ms (Views: 10.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN 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]]  (0.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.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", "2020-12-22 13:08:01.168307"], ["updated_at", "2020-12-22 13:08:01.168307"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 6.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:01.174753"], ["updated_at", "2020-12-22 13:08:01.174753"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (4.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "2020-12-22 13:08:01.203292"], ["updated_at", "2020-12-22 13:08:01.203292"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 3.0ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:01.214007"], ["updated_at", "2020-12-22 13:08:01.214007"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.219935"], ["updated_at", "2020-12-22 13:08:01.219935"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.223139"], ["updated_at", "2020-12-22 13:08:01.223139"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.225882"], ["updated_at", "2020-12-22 13:08:01.225882"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:08:01.230682"], ["updated_at", "2020-12-22 13:08:01.230682"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.237439"], ["updated_at", "2020-12-22 13:08:01.237439"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.240378"], ["updated_at", "2020-12-22 13:08:01.240378"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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", "2020-12-22 13:08:01.247181"], ["updated_at", "2020-12-22 13:08:01.247181"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556081"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.250027"], ["updated_at", "2020-12-22 13:08:01.250027"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 581], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:08:01.282955"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 581]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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", "2020-12-22 13:08:01.287000"], ["updated_at", "2020-12-22 13:08:01.287000"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728881"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.290201"], ["updated_at", "2020-12-22 13:08:01.290201"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.294543"], ["updated_at", "2020-12-22 13:08:01.294543"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.297095"], ["updated_at", "2020-12-22 13:08:01.297095"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 583], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:08:01.299946"], ["id", 583]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.303382"], ["updated_at", "2020-12-22 13:08:01.303382"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.306124"], ["updated_at", "2020-12-22 13:08:01.306124"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 585], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:08:01.309555"], ["id", 585]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 585], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.315198"], ["updated_at", "2020-12-22 13:08:01.315198"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.317011"], ["updated_at", "2020-12-22 13:08:01.317011"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 587], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:08:01.319596"], ["id", 587]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 587], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.323783"], ["updated_at", "2020-12-22 13:08:01.323783"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.325823"], ["updated_at", "2020-12-22 13:08:01.325823"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.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", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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", "2020-12-22 13:08:01.331262"], ["updated_at", "2020-12-22 13:08:01.331262"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.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]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:08:01.338291"], ["updated_at", "2020-12-22 13:08:01.338291"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (6.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.341908"], ["updated_at", "2020-12-22 13:08:01.341908"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:08:01.354944"], ["updated_at", "2020-12-22 13:08:01.354944"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.357560"], ["updated_at", "2020-12-22 13:08:01.357560"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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 (0.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.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", "2020-12-22 13:08:01.362931"], ["updated_at", "2020-12-22 13:08:01.362931"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.365532"], ["updated_at", "2020-12-22 13:08:01.365532"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.369685"], ["updated_at", "2020-12-22 13:08:01.369685"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.372154"], ["updated_at", "2020-12-22 13:08:01.372154"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:08:01.380284"], ["updated_at", "2020-12-22 13:08:01.380284"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 600], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 600], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:08:01.383114"], ["id", 600]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 600], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.387405"], ["updated_at", "2020-12-22 13:08:01.387405"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.389365"], ["updated_at", "2020-12-22 13:08:01.389365"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.391164"], ["updated_at", "2020-12-22 13:08:01.391164"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.393412"], ["updated_at", "2020-12-22 13:08:01.393412"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.401130"], ["updated_at", "2020-12-22 13:08:01.401130"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.430370"], ["updated_at", "2020-12-22 13:08:01.430370"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.433369"], ["updated_at", "2020-12-22 13:08:01.433369"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.459524"], ["updated_at", "2020-12-22 13:08:01.459524"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.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)  (0.3ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.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.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.517960"], ["updated_at", "2020-12-22 13:08:01.517960"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.523927"], ["updated_at", "2020-12-22 13:08:01.523927"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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", "2020-12-22 13:08:01.531663"], ["updated_at", "2020-12-22 13:08:01.531663"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.7ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:01.572326"], ["updated_at", "2020-12-22 13:08:01.572326"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:01.576234"], ["updated_at", "2020-12-22 13:08:01.576234"], ["synced_id", 123]]  (4.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:01.604158"], ["updated_at", "2020-12-22 13:08:01.604158"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:01.625939"], ["updated_at", "2020-12-22 13:08:01.625939"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 631], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 631], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:08:01.630425"], ["id", 631]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 631], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:01.634511"], ["updated_at", "2020-12-22 13:08:01.634511"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728881"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:01.638447"], ["updated_at", "2020-12-22 13:08:01.638447"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556081"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 633], ["LIMIT", 1]] Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:08:01.657892"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 633]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:01.662472"], ["updated_at", "2020-12-22 13:08:01.662472"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.667062"], ["updated_at", "2020-12-22 13:08:01.667062"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:01.670971"], ["updated_at", "2020-12-22 13:08:01.670971"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.675590"], ["updated_at", "2020-12-22 13:08:01.675590"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:01.679909"], ["updated_at", "2020-12-22 13:08:01.679909"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.683305"], ["updated_at", "2020-12-22 13:08:01.683305"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 13:08:01.686715"], ["updated_at", "2020-12-22 13:08:01.686715"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.690258"], ["updated_at", "2020-12-22 13:08:01.690258"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:01.692674"], ["updated_at", "2020-12-22 13:08:01.692674"], ["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.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.697774"], ["updated_at", "2020-12-22 13:08:01.697774"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.699710"], ["updated_at", "2020-12-22 13:08:01.699710"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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.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", "2020-12-22 13:08:01.703404"], ["id", 644]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.707052"], ["updated_at", "2020-12-22 13:08:01.707052"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.709107"], ["updated_at", "2020-12-22 13:08:01.709107"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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.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", "2020-12-22 13:08:01.712436"], ["id", 646]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.715875"], ["updated_at", "2020-12-22 13:08:01.715875"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.718187"], ["updated_at", "2020-12-22 13:08:01.718187"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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 (0.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", "2020-12-22 13:08:01.721058"], ["id", 648]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 648], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.724882"], ["updated_at", "2020-12-22 13:08:01.724882"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:01.726981"], ["updated_at", "2020-12-22 13:08:01.726981"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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.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", "2020-12-22 13:08:01.730896"], ["id", 650]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 650], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:01.737745"], ["updated_at", "2020-12-22 13:08:01.737745"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:01.739954"], ["updated_at", "2020-12-22 13:08:01.739954"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:01.742447"], ["updated_at", "2020-12-22 13:08:01.742447"], ["synced_id", 3]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:08:01.752629"], ["updated_at", "2020-12-22 13:08:01.752629"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:08:01.754128"], ["synced_id", 0], ["id", 654]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:01.798551"], ["updated_at", "2020-12-22 13:08:01.798551"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.803506"], ["updated_at", "2020-12-22 13:08:01.803506"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.817450"], ["updated_at", "2020-12-22 13:08:01.817450"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.829121"], ["updated_at", "2020-12-22 13:08:01.829121"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.837149"], ["updated_at", "2020-12-22 13:08:01.837149"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.849204"], ["updated_at", "2020-12-22 13:08:01.849204"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:01.862600"], ["updated_at", "2020-12-22 13:08:01.862600"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (2.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:15.991914"], ["updated_at", "2020-12-22 13:08:15.991914"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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", "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", "2020-12-22 13:08:16.012566"], ["updated_at", "2020-12-22 13:08:16.012566"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.016400"], ["updated_at", "2020-12-22 13:08:16.016400"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists? (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) 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", "2020-12-22 13:08:16.036417"], ["updated_at", "2020-12-22 13:08:16.036417"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.057794"], ["updated_at", "2020-12-22 13:08:16.057794"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.065325"], ["updated_at", "2020-12-22 13:08:16.065325"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.4ms) 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.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.079199"], ["updated_at", "2020-12-22 13:08:16.079199"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.097311"], ["updated_at", "2020-12-22 13:08:16.097311"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.109199"], ["updated_at", "2020-12-22 13:08:16.109199"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.121165"], ["updated_at", "2020-12-22 13:08:16.121165"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 8ms (ActiveRecord: 0.0ms | Allocations: 1070)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (Duration: 0.0ms | Allocations: 5) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 7ms (Views: 6.6ms | ActiveRecord: 0.0ms | Allocations: 843)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 3.6ms | ActiveRecord: 0.0ms | Allocations: 336)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms | Allocations: 182)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.170649"], ["updated_at", "2020-12-22 13:08:16.170649"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.172919"], ["updated_at", "2020-12-22 13:08:16.172919"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.176924"], ["updated_at", "2020-12-22 13:08:16.176924"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", "2020-12-22 13:08:16.179508"], ["updated_at", "2020-12-22 13:08:16.179508"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:08:16.188305"], ["updated_at", "2020-12-22 13:08:16.188305"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.3ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:08:16.195485"], ["updated_at", "2020-12-22 13:08:16.195485"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.197767"], ["updated_at", "2020-12-22 13:08:16.197767"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:08:16.201924"], ["updated_at", "2020-12-22 13:08:16.201924"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.203846"], ["updated_at", "2020-12-22 13:08:16.203846"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:08:16.208148"], ["updated_at", "2020-12-22 13:08:16.208148"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.210967"], ["updated_at", "2020-12-22 13:08:16.210967"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.216402"], ["updated_at", "2020-12-22 13:08:16.216402"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.218357"], ["updated_at", "2020-12-22 13:08:16.218357"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 622], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:08:16.221160"], ["id", 622]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.224686"], ["updated_at", "2020-12-22 13:08:16.224686"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.227306"], ["updated_at", "2020-12-22 13:08:16.227306"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 624], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:08:16.230028"], ["id", 624]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 624], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.234652"], ["updated_at", "2020-12-22 13:08:16.234652"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.236658"], ["updated_at", "2020-12-22 13:08:16.236658"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 626], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:08:16.239955"], ["id", 626]]  (0.1ms) 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", 626], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.245156"], ["updated_at", "2020-12-22 13:08:16.245156"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.248016"], ["updated_at", "2020-12-22 13:08:16.248016"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:08:16.300513"], ["updated_at", "2020-12-22 13:08:16.300513"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.306710"], ["updated_at", "2020-12-22 13:08:16.306710"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) 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", "2020-12-22 13:08:16.310260"], ["updated_at", "2020-12-22 13:08:16.310260"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.315225"], ["updated_at", "2020-12-22 13:08:16.315225"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:08:16.318949"], ["updated_at", "2020-12-22 13:08:16.318949"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 631], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 631], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:08:16.321697"], ["id", 631]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 631], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.327862"], ["updated_at", "2020-12-22 13:08:16.327862"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.353842"], ["updated_at", "2020-12-22 13:08:16.353842"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) 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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists? (0.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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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.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", "2020-12-22 13:08:16.369531"], ["updated_at", "2020-12-22 13:08:16.369531"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556096"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.373997"], ["updated_at", "2020-12-22 13:08:16.373997"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 633], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:08:16.391378"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 633]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:08:16.395595"], ["updated_at", "2020-12-22 13:08:16.395595"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728896"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.398485"], ["updated_at", "2020-12-22 13:08:16.398485"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.402174"], ["updated_at", "2020-12-22 13:08:16.402174"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.404036"], ["updated_at", "2020-12-22 13:08:16.404036"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.405903"], ["updated_at", "2020-12-22 13:08:16.405903"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.408309"], ["updated_at", "2020-12-22 13:08:16.408309"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.412103"], ["updated_at", "2020-12-22 13:08:16.412103"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:08:16.414885"], ["updated_at", "2020-12-22 13:08:16.414885"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:16.421399"], ["updated_at", "2020-12-22 13:08:16.421399"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms | Allocations: 936)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:16.427659"], ["updated_at", "2020-12-22 13:08:16.427659"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.1ms | Allocations: 874)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:16.436639"], ["updated_at", "2020-12-22 13:08:16.436639"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms | Allocations: 882)  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:08:16.445210"], ["updated_at", "2020-12-22 13:08:16.445210"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms | Allocations: 966)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 119)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 118)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 2.1ms | Allocations: 262) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 14ms (Views: 4.0ms | ActiveRecord: 0.0ms | Allocations: 1929)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 0.2ms | Allocations: 54) 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 | Allocations: 426)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:16.475565"], ["updated_at", "2020-12-22 13:08:16.475565"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:16.477583"], ["updated_at", "2020-12-22 13:08:16.477583"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:16.479196"], ["updated_at", "2020-12-22 13:08:16.479196"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:08:16.482610"], ["updated_at", "2020-12-22 13:08:16.482610"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:08:16.483916"], ["synced_id", 0], ["id", 663]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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", "2020-12-22 13:08:16.491689"], ["updated_at", "2020-12-22 13:08:16.491689"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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", "2020-12-22 13:08:16.496085"], ["updated_at", "2020-12-22 13:08:16.496085"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:08:16.514972"], ["updated_at", "2020-12-22 13:08:16.514972"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.9ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.537017"], ["updated_at", "2020-12-22 13:08:16.537017"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", "2020-12-22 13:08:16.541570"], ["updated_at", "2020-12-22 13:08:16.541570"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.547492"], ["updated_at", "2020-12-22 13:08:16.547492"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:16.550081"], ["updated_at", "2020-12-22 13:08:16.550081"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.553050"], ["updated_at", "2020-12-22 13:08:16.553050"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:16.555586"], ["updated_at", "2020-12-22 13:08:16.555586"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.559012"], ["updated_at", "2020-12-22 13:08:16.559012"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:16.562367"], ["updated_at", "2020-12-22 13:08:16.562367"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.565910"], ["updated_at", "2020-12-22 13:08:16.565910"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.567804"], ["updated_at", "2020-12-22 13:08:16.567804"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 676], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:08:16.571011"], ["id", 676]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.574460"], ["updated_at", "2020-12-22 13:08:16.574460"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.576804"], ["updated_at", "2020-12-22 13:08:16.576804"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 678], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:08:16.579251"], ["id", 678]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.583241"], ["updated_at", "2020-12-22 13:08:16.583241"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.585214"], ["updated_at", "2020-12-22 13:08:16.585214"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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", 680], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:08:16.588755"], ["id", 680]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 680], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.593061"], ["updated_at", "2020-12-22 13:08:16.593061"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:08:16.595754"], ["updated_at", "2020-12-22 13:08:16.595754"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 682], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:08:16.598267"], ["id", 682]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 682], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:16.601849"], ["updated_at", "2020-12-22 13:08:16.601849"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 683], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 683], ["LIMIT", 1]] Account Update (0.2ms) 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", "2020-12-22 13:08:16.604504"], ["id", 683]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 683], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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", "2020-12-22 13:08:16.608310"], ["updated_at", "2020-12-22 13:08:16.608310"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:16.611816"], ["updated_at", "2020-12-22 13:08:16.611816"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:16.615203"], ["updated_at", "2020-12-22 13:08:16.615203"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608728896"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:08:16.618249"], ["updated_at", "2020-12-22 13:08:16.618249"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556096"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 687], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:08:16.634846"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 687]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (5.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]] SQL (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", "2020-12-22 13:12:05.689209"], ["updated_at", "2020-12-22 13:12:05.689209"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 641], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 641], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:05.718055"], ["id", 641]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 641], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.069183"], ["updated_at", "2020-12-22 13:12:06.069183"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.101460"], ["updated_at", "2020-12-22 13:12:06.101460"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.111604"], ["updated_at", "2020-12-22 13:12:06.111604"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) 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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.140077"], ["updated_at", "2020-12-22 13:12:06.140077"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.147312"], ["updated_at", "2020-12-22 13:12:06.147312"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:12:06.158307"], ["updated_at", "2020-12-22 13:12:06.158307"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:12:06.166957"], ["updated_at", "2020-12-22 13:12:06.166957"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" 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.tesu"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.212728"], ["updated_at", "2020-12-22 13:12:06.212728"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.286067"], ["updated_at", "2020-12-22 13:12:06.286067"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.288942"], ["updated_at", "2020-12-22 13:12:06.288942"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.295246"], ["updated_at", "2020-12-22 13:12:06.295246"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.297554"], ["updated_at", "2020-12-22 13:12:06.297554"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:12:06.301922"], ["updated_at", "2020-12-22 13:12:06.301922"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:12:06.307073"], ["updated_at", "2020-12-22 13:12:06.307073"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.309425"], ["updated_at", "2020-12-22 13:12:06.309425"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:12:06.313278"], ["updated_at", "2020-12-22 13:12:06.313278"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.315339"], ["updated_at", "2020-12-22 13:12:06.315339"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:12:06.319956"], ["updated_at", "2020-12-22 13:12:06.319956"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.324311"], ["updated_at", "2020-12-22 13:12:06.324311"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.330272"], ["updated_at", "2020-12-22 13:12:06.330272"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.332308"], ["updated_at", "2020-12-22 13:12:06.332308"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) 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", 657], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.335880"], ["id", 657]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.339901"], ["updated_at", "2020-12-22 13:12:06.339901"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:12:06.342394"], ["updated_at", "2020-12-22 13:12:06.342394"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 659], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.347089"], ["id", 659]]  (0.1ms) 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", 659], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.353993"], ["updated_at", "2020-12-22 13:12:06.353993"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.357952"], ["updated_at", "2020-12-22 13:12:06.357952"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 661], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.361054"], ["id", 661]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 661], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.365177"], ["updated_at", "2020-12-22 13:12:06.365177"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.369383"], ["updated_at", "2020-12-22 13:12:06.369383"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:12:06.405974"], ["updated_at", "2020-12-22 13:12:06.405974"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556326"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.409456"], ["updated_at", "2020-12-22 13:12:06.409456"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 664], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.425821"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 664]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:12:06.429051"], ["updated_at", "2020-12-22 13:12:06.429051"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729126"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.431934"], ["updated_at", "2020-12-22 13:12:06.431934"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.436490"], ["updated_at", "2020-12-22 13:12:06.436490"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.438815"], ["updated_at", "2020-12-22 13:12:06.438815"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.440826"], ["updated_at", "2020-12-22 13:12:06.440826"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.442743"], ["updated_at", "2020-12-22 13:12:06.442743"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:12:06.486397"], ["updated_at", "2020-12-22 13:12:06.486397"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.497655"], ["updated_at", "2020-12-22 13:12:06.497655"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one 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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.500346"], ["updated_at", "2020-12-22 13:12:06.500346"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 6ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 9ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.546713"], ["updated_at", "2020-12-22 13:12:06.546713"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.563662"], ["updated_at", "2020-12-22 13:12:06.563662"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.580181"], ["updated_at", "2020-12-22 13:12:06.580181"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.591150"], ["updated_at", "2020-12-22 13:12:06.591150"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.607863"], ["updated_at", "2020-12-22 13:12:06.607863"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.622854"], ["updated_at", "2020-12-22 13:12:06.622854"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.630829"], ["updated_at", "2020-12-22 13:12:06.630829"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:12:06.636403"], ["updated_at", "2020-12-22 13:12:06.636403"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:12:06.640565"], ["updated_at", "2020-12-22 13:12:06.640565"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:12:06.642652"], ["updated_at", "2020-12-22 13:12:06.642652"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:12:06.644869"], ["updated_at", "2020-12-22 13:12:06.644869"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) 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]] SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.653152"], ["updated_at", "2020-12-22 13:12:06.653152"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.657066"], ["updated_at", "2020-12-22 13:12:06.657066"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 695], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.660639"], ["id", 695]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 695], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.665663"], ["updated_at", "2020-12-22 13:12:06.665663"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.668680"], ["updated_at", "2020-12-22 13:12:06.668680"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 697], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.673352"], ["id", 697]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 697], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.678081"], ["updated_at", "2020-12-22 13:12:06.678081"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.680648"], ["updated_at", "2020-12-22 13:12:06.680648"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 699], ["LIMIT", 1]] SQL (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", "2020-12-22 13:12:06.684747"], ["id", 699]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.690516"], ["updated_at", "2020-12-22 13:12:06.690516"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.692701"], ["updated_at", "2020-12-22 13:12:06.692701"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 701], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.697323"], ["id", 701]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.701671"], ["updated_at", "2020-12-22 13:12:06.701671"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.706120"], ["updated_at", "2020-12-22 13:12:06.706120"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.710218"], ["updated_at", "2020-12-22 13:12:06.710218"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.713481"], ["updated_at", "2020-12-22 13:12:06.713481"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.718158"], ["updated_at", "2020-12-22 13:12:06.718158"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.722403"], ["updated_at", "2020-12-22 13:12:06.722403"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:12:06.726569"], ["updated_at", "2020-12-22 13:12:06.726569"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.729318"], ["updated_at", "2020-12-22 13:12:06.729318"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:12:06.740316"], ["updated_at", "2020-12-22 13:12:06.740316"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:12:06.741796"], ["synced_id", 0], ["id", 710]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.748103"], ["updated_at", "2020-12-22 13:12:06.748103"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 711], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 711], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 13:12:06.754680"], ["id", 711]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 711], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.759478"], ["updated_at", "2020-12-22 13:12:06.759478"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729126"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.763053"], ["updated_at", "2020-12-22 13:12:06.763053"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556326"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 713], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:12:06.781120"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 713]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:12:06.787347"], ["updated_at", "2020-12-22 13:12:06.787347"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:12:06.790634"], ["updated_at", "2020-12-22 13:12:06.790634"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:12:06.810910"], ["updated_at", "2020-12-22 13:12:06.810910"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:12:06.815943"], ["updated_at", "2020-12-22 13:12:06.815943"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 2.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.846343"], ["updated_at", "2020-12-22 13:12:06.846343"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:12:06.851841"], ["updated_at", "2020-12-22 13:12:06.851841"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:12:06.863344"], ["updated_at", "2020-12-22 13:12:06.863344"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:12:06.875345"], ["updated_at", "2020-12-22 13:12:06.875345"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.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]] SQL (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.680155"], ["updated_at", "2020-12-22 13:13:14.680155"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.687891"], ["updated_at", "2020-12-22 13:13:14.687891"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (1.0ms) BEGIN  (0.1ms) 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]] SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:14.732340"], ["updated_at", "2020-12-22 13:13:14.732340"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (1.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:14.758593"], ["updated_at", "2020-12-22 13:13:14.758593"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:14.761742"], ["updated_at", "2020-12-22 13:13:14.761742"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:14.765876"], ["updated_at", "2020-12-22 13:13:14.765876"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:14.770843"], ["updated_at", "2020-12-22 13:13:14.770843"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:14.807423"], ["updated_at", "2020-12-22 13:13:14.807423"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.845126"], ["updated_at", "2020-12-22 13:13:14.845126"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:13:14.862258"], ["updated_at", "2020-12-22 13:13:14.862258"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:13:14.863886"], ["synced_id", 0], ["id", 727]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:14.877462"], ["updated_at", "2020-12-22 13:13:14.877462"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.881080"], ["updated_at", "2020-12-22 13:13:14.881080"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 729], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 729], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 13:13:14.884055"], ["id", 729]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 729], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:14.887642"], ["updated_at", "2020-12-22 13:13:14.887642"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.911392"], ["updated_at", "2020-12-22 13:13:14.911392"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.915651"], ["updated_at", "2020-12-22 13:13:14.915651"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.919297"], ["updated_at", "2020-12-22 13:13:14.919297"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.921589"], ["updated_at", "2020-12-22 13:13:14.921589"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.924885"], ["updated_at", "2020-12-22 13:13:14.924885"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.927417"], ["updated_at", "2020-12-22 13:13:14.927417"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.932813"], ["updated_at", "2020-12-22 13:13:14.932813"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.935778"], ["updated_at", "2020-12-22 13:13:14.935778"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.939380"], ["updated_at", "2020-12-22 13:13:14.939380"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.941310"], ["updated_at", "2020-12-22 13:13:14.941310"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 740], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.943868"], ["id", 740]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 740], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.948261"], ["updated_at", "2020-12-22 13:13:14.948261"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.950117"], ["updated_at", "2020-12-22 13:13:14.950117"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 742], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.952654"], ["id", 742]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 742], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.956432"], ["updated_at", "2020-12-22 13:13:14.956432"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.958272"], ["updated_at", "2020-12-22 13:13:14.958272"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 744], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.960674"], ["id", 744]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.964366"], ["updated_at", "2020-12-22 13:13:14.964366"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:14.966414"], ["updated_at", "2020-12-22 13:13:14.966414"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 746], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.969203"], ["id", 746]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.972808"], ["updated_at", "2020-12-22 13:13:14.972808"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556394"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 747], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:13:14.988924"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 747]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:14.991962"], ["updated_at", "2020-12-22 13:13:14.991962"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729194"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.005374"], ["updated_at", "2020-12-22 13:13:15.005374"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.019058"], ["updated_at", "2020-12-22 13:13:15.019058"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.031481"], ["updated_at", "2020-12-22 13:13:15.031481"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.038954"], ["updated_at", "2020-12-22 13:13:15.038954"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.050619"], ["updated_at", "2020-12-22 13:13:15.050619"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.058206"], ["updated_at", "2020-12-22 13:13:15.058206"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.067667"], ["updated_at", "2020-12-22 13:13:15.067667"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:15.072612"], ["updated_at", "2020-12-22 13:13:15.072612"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:15.074887"], ["updated_at", "2020-12-22 13:13:15.074887"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:15.076906"], ["updated_at", "2020-12-22 13:13:15.076906"], ["synced_id", 1], ["host", "example2.test"]]  (0.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" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:15.082491"], ["updated_at", "2020-12-22 13:13:15.082491"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (3.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:15.092117"], ["updated_at", "2020-12-22 13:13:15.092117"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (4.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.099264"], ["updated_at", "2020-12-22 13:13:15.099264"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.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]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:15.133532"], ["updated_at", "2020-12-22 13:13:15.133532"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729195"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.136608"], ["updated_at", "2020-12-22 13:13:15.136608"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:15.140779"], ["updated_at", "2020-12-22 13:13:15.140779"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556395"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.143912"], ["updated_at", "2020-12-22 13:13:15.143912"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 681], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:13:15.160606"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 681]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:15.164495"], ["updated_at", "2020-12-22 13:13:15.164495"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.167697"], ["updated_at", "2020-12-22 13:13:15.167697"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:15.171922"], ["updated_at", "2020-12-22 13:13:15.171922"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.175005"], ["updated_at", "2020-12-22 13:13:15.175005"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.177845"], ["updated_at", "2020-12-22 13:13:15.177845"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:15.182740"], ["updated_at", "2020-12-22 13:13:15.182740"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:13:15.187076"], ["updated_at", "2020-12-22 13:13:15.187076"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.190708"], ["updated_at", "2020-12-22 13:13:15.190708"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:13:15.195318"], ["updated_at", "2020-12-22 13:13:15.195318"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.198707"], ["updated_at", "2020-12-22 13:13:15.198707"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:15.204000"], ["updated_at", "2020-12-22 13:13:15.204000"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:15.208858"], ["updated_at", "2020-12-22 13:13:15.208858"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.210950"], ["updated_at", "2020-12-22 13:13:15.210950"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:15.215699"], ["updated_at", "2020-12-22 13:13:15.215699"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.218015"], ["updated_at", "2020-12-22 13:13:15.218015"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:15.222150"], ["updated_at", "2020-12-22 13:13:15.222150"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.224599"], ["updated_at", "2020-12-22 13:13:15.224599"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.228393"], ["updated_at", "2020-12-22 13:13:15.228393"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.231488"], ["updated_at", "2020-12-22 13:13:15.231488"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 696], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:15.234946"], ["id", 696]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.239240"], ["updated_at", "2020-12-22 13:13:15.239240"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.241423"], ["updated_at", "2020-12-22 13:13:15.241423"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 698], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:15.244227"], ["id", 698]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 698], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.249221"], ["updated_at", "2020-12-22 13:13:15.249221"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.251550"], ["updated_at", "2020-12-22 13:13:15.251550"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 700], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:15.254407"], ["id", 700]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 700], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.258142"], ["updated_at", "2020-12-22 13:13:15.258142"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:15.267064"], ["updated_at", "2020-12-22 13:13:15.267064"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 703], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 703], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:15.269865"], ["id", 703]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 703], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:15.274863"], ["updated_at", "2020-12-22 13:13:15.274863"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:15.306534"], ["updated_at", "2020-12-22 13:13:15.306534"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:15.318723"], ["updated_at", "2020-12-22 13:13:15.318723"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.7ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:15.324582"], ["updated_at", "2020-12-22 13:13:15.324582"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:15.333837"], ["updated_at", "2020-12-22 13:13:15.333837"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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: 2.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 19ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:27.524685"], ["updated_at", "2020-12-22 13:13:27.524685"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:27.563045"], ["updated_at", "2020-12-22 13:13:27.563045"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (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", "2020-12-22 13:13:27.628166"], ["updated_at", "2020-12-22 13:13:27.628166"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (1.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 754], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 754], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:27.655694"], ["id", 754]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 754], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:27.664120"], ["updated_at", "2020-12-22 13:13:27.664120"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:27.666714"], ["updated_at", "2020-12-22 13:13:27.666714"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:27.668401"], ["updated_at", "2020-12-22 13:13:27.668401"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:27.678355"], ["updated_at", "2020-12-22 13:13:27.678355"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:27.682390"], ["updated_at", "2020-12-22 13:13:27.682390"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:27.688196"], ["updated_at", "2020-12-22 13:13:27.688196"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556407"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 760], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:13:27.710817"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 760]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:13:27.717941"], ["updated_at", "2020-12-22 13:13:27.717941"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729207"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.725309"], ["updated_at", "2020-12-22 13:13:27.725309"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.728607"], ["updated_at", "2020-12-22 13:13:27.728607"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 763], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:27.734463"], ["id", 763]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 763], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.744317"], ["updated_at", "2020-12-22 13:13:27.744317"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.764270"], ["updated_at", "2020-12-22 13:13:27.764270"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 765], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:27.766762"], ["id", 765]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 765], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.770786"], ["updated_at", "2020-12-22 13:13:27.770786"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.772629"], ["updated_at", "2020-12-22 13:13:27.772629"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 767], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:27.775381"], ["id", 767]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.779107"], ["updated_at", "2020-12-22 13:13:27.779107"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.780984"], ["updated_at", "2020-12-22 13:13:27.780984"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 769], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:27.783340"], ["id", 769]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.787948"], ["updated_at", "2020-12-22 13:13:27.787948"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:27.791812"], ["updated_at", "2020-12-22 13:13:27.791812"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.795651"], ["updated_at", "2020-12-22 13:13:27.795651"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:27.797968"], ["updated_at", "2020-12-22 13:13:27.797968"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.801001"], ["updated_at", "2020-12-22 13:13:27.801001"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:27.803401"], ["updated_at", "2020-12-22 13:13:27.803401"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.807081"], ["updated_at", "2020-12-22 13:13:27.807081"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:27.809454"], ["updated_at", "2020-12-22 13:13:27.809454"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:27.812381"], ["updated_at", "2020-12-22 13:13:27.812381"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:13:27.821397"], ["updated_at", "2020-12-22 13:13:27.821397"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:13:27.823052"], ["synced_id", 0], ["id", 779]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (4.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:27.873953"], ["updated_at", "2020-12-22 13:13:27.873953"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:27.885024"], ["updated_at", "2020-12-22 13:13:27.885024"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:27.895144"], ["updated_at", "2020-12-22 13:13:27.895144"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:27.914441"], ["updated_at", "2020-12-22 13:13:27.914441"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:27.928365"], ["updated_at", "2020-12-22 13:13:27.928365"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:27.945722"], ["updated_at", "2020-12-22 13:13:27.945722"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (2.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.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.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (5.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]] SQL (2.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:27.997230"], ["updated_at", "2020-12-22 13:13:27.997230"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.004710"], ["updated_at", "2020-12-22 13:13:28.004710"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) 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.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:28.034161"], ["updated_at", "2020-12-22 13:13:28.034161"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:28.039860"], ["updated_at", "2020-12-22 13:13:28.039860"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 707], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 707], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 13:13:28.043817"], ["id", 707]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 707], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:28.050691"], ["updated_at", "2020-12-22 13:13:28.050691"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.055160"], ["updated_at", "2020-12-22 13:13:28.055160"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.060317"], ["updated_at", "2020-12-22 13:13:28.060317"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.066603"], ["updated_at", "2020-12-22 13:13:28.066603"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.069442"], ["updated_at", "2020-12-22 13:13:28.069442"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.074245"], ["updated_at", "2020-12-22 13:13:28.074245"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.076467"], ["updated_at", "2020-12-22 13:13:28.076467"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:28.082560"], ["updated_at", "2020-12-22 13:13:28.082560"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:28.088515"], ["updated_at", "2020-12-22 13:13:28.088515"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.091189"], ["updated_at", "2020-12-22 13:13:28.091189"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) 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.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:28.096769"], ["updated_at", "2020-12-22 13:13:28.096769"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.099005"], ["updated_at", "2020-12-22 13:13:28.099005"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) 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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:13:28.104689"], ["updated_at", "2020-12-22 13:13:28.104689"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.108403"], ["updated_at", "2020-12-22 13:13:28.108403"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.112740"], ["updated_at", "2020-12-22 13:13:28.112740"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.114897"], ["updated_at", "2020-12-22 13:13:28.114897"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 720], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:28.117791"], ["id", 720]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.122586"], ["updated_at", "2020-12-22 13:13:28.122586"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:13:28.125485"], ["updated_at", "2020-12-22 13:13:28.125485"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 722], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:28.130134"], ["id", 722]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 722], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.135087"], ["updated_at", "2020-12-22 13:13:28.135087"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.138124"], ["updated_at", "2020-12-22 13:13:28.138124"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 724], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:28.142233"], ["id", 724]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 724], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "example.test"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:28.149078"], ["updated_at", "2020-12-22 13:13:28.149078"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:28.151329"], ["updated_at", "2020-12-22 13:13:28.151329"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:28.154188"], ["updated_at", "2020-12-22 13:13:28.154188"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:28.156558"], ["updated_at", "2020-12-22 13:13:28.156558"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:28.163538"], ["updated_at", "2020-12-22 13:13:28.163538"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.168422"], ["updated_at", "2020-12-22 13:13:28.168422"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:28.174734"], ["updated_at", "2020-12-22 13:13:28.174734"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729208"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.179048"], ["updated_at", "2020-12-22 13:13:28.179048"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:28.185180"], ["updated_at", "2020-12-22 13:13:28.185180"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556408"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.190216"], ["updated_at", "2020-12-22 13:13:28.190216"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.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"."id" != $2) AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 732], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:13:28.217899"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 732]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.226557"], ["updated_at", "2020-12-22 13:13:28.226557"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:13:28.236943"], ["updated_at", "2020-12-22 13:13:28.236943"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 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 Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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]]  (0.3ms) ROLLBACK  (0.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 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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 27ms (Views: 26.1ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.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 6ms (Views: 5.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:28.338631"], ["updated_at", "2020-12-22 13:13:28.338631"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:28.345982"], ["updated_at", "2020-12-22 13:13:28.345982"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:13:28.354007"], ["updated_at", "2020-12-22 13:13:28.354007"], ["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.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.0ms)  (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:13:28.365790"], ["updated_at", "2020-12-22 13:13:28.365790"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 4ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.4ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:28.385957"], ["updated_at", "2020-12-22 13:13:28.385957"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:28.401837"], ["updated_at", "2020-12-22 13:13:28.401837"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:28.408424"], ["updated_at", "2020-12-22 13:13:28.408424"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:28.410909"], ["updated_at", "2020-12-22 13:13:28.410909"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (1.1ms) BEGIN  (0.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.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:42.778423"], ["updated_at", "2020-12-22 13:13:42.778423"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:42.783825"], ["updated_at", "2020-12-22 13:13:42.783825"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:42.786664"], ["updated_at", "2020-12-22 13:13:42.786664"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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", "2020-12-22 13:13:42.790716"], ["updated_at", "2020-12-22 13:13:42.790716"], ["synced_id", 3]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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", "2020-12-22 13:13:42.803692"], ["updated_at", "2020-12-22 13:13:42.803692"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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.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", "2020-12-22 13:13:42.812998"], ["updated_at", "2020-12-22 13:13:42.812998"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:42.817853"], ["updated_at", "2020-12-22 13:13:42.817853"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:42.820837"], ["updated_at", "2020-12-22 13:13:42.820837"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:42.824479"], ["updated_at", "2020-12-22 13:13:42.824479"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:42.827625"], ["updated_at", "2020-12-22 13:13:42.827625"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:42.830838"], ["updated_at", "2020-12-22 13:13:42.830838"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) 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.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:42.834230"], ["updated_at", "2020-12-22 13:13:42.834230"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:42.840125"], ["updated_at", "2020-12-22 13:13:42.840125"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:42.842782"], ["updated_at", "2020-12-22 13:13:42.842782"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 797], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:13:42.847194"], ["id", 797]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:42.851957"], ["updated_at", "2020-12-22 13:13:42.851957"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:42.853975"], ["updated_at", "2020-12-22 13:13:42.853975"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 799], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:13:42.860505"], ["id", 799]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:42.866716"], ["updated_at", "2020-12-22 13:13:42.866716"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:42.870173"], ["updated_at", "2020-12-22 13:13:42.870173"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 801], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:13:42.873665"], ["id", 801]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 801], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:42.878272"], ["updated_at", "2020-12-22 13:13:42.878272"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:42.880198"], ["updated_at", "2020-12-22 13:13:42.880198"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 803], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:13:42.884458"], ["id", 803]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 803], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:42.889545"], ["updated_at", "2020-12-22 13:13:42.889545"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:42.896534"], ["updated_at", "2020-12-22 13:13:42.896534"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 805], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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.2ms) 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", "2020-12-22 13:13:42.899586"], ["id", 805]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 805], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:42.942373"], ["updated_at", "2020-12-22 13:13:42.942373"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:42.946542"], ["updated_at", "2020-12-22 13:13:42.946542"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556422"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 807], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:13:42.979003"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 807]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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", "2020-12-22 13:13:42.982605"], ["updated_at", "2020-12-22 13:13:42.982605"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729222"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:42.986607"], ["updated_at", "2020-12-22 13:13:42.986607"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:43.005725"], ["updated_at", "2020-12-22 13:13:43.005725"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:13:43.065031"], ["updated_at", "2020-12-22 13:13:43.065031"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Update (0.6ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:13:43.066744"], ["synced_id", 0], ["id", 811]]  (4.4ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.9ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 56ms (Views: 54.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:43.178685"], ["updated_at", "2020-12-22 13:13:43.178685"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) 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.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:43.185346"], ["updated_at", "2020-12-22 13:13:43.185346"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.6ms)  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:43.193214"], ["updated_at", "2020-12-22 13:13:43.193214"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (2.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "2020-12-22 13:13:43.220514"], ["updated_at", "2020-12-22 13:13:43.220514"], ["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.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 19ms (ActiveRecord: 3.9ms)  (0.3ms) 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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) 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", "2020-12-22 13:13:43.245259"], ["updated_at", "2020-12-22 13:13:43.245259"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.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", "2020-12-22 13:13:43.252562"], ["updated_at", "2020-12-22 13:13:43.252562"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729223"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.256335"], ["updated_at", "2020-12-22 13:13:43.256335"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.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", "2020-12-22 13:13:43.261203"], ["updated_at", "2020-12-22 13:13:43.261203"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556423"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.264794"], ["updated_at", "2020-12-22 13:13:43.264794"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 739], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:13:43.284557"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 739]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:43.288792"], ["updated_at", "2020-12-22 13:13:43.288792"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.292671"], ["updated_at", "2020-12-22 13:13:43.292671"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:43.296746"], ["updated_at", "2020-12-22 13:13:43.296746"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.300190"], ["updated_at", "2020-12-22 13:13:43.300190"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.303816"], ["updated_at", "2020-12-22 13:13:43.303816"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:13:43.308508"], ["updated_at", "2020-12-22 13:13:43.308508"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.312324"], ["updated_at", "2020-12-22 13:13:43.312324"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.314762"], ["updated_at", "2020-12-22 13:13:43.314762"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.319051"], ["updated_at", "2020-12-22 13:13:43.319051"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.321359"], ["updated_at", "2020-12-22 13:13:43.321359"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:13:43.325336"], ["updated_at", "2020-12-22 13:13:43.325336"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) 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.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", "2020-12-22 13:13:43.330605"], ["updated_at", "2020-12-22 13:13:43.330605"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.332808"], ["updated_at", "2020-12-22 13:13:43.332808"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.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", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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", "2020-12-22 13:13:43.340614"], ["updated_at", "2020-12-22 13:13:43.340614"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.342744"], ["updated_at", "2020-12-22 13:13:43.342744"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.8ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:13:43.347806"], ["updated_at", "2020-12-22 13:13:43.347806"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.350531"], ["updated_at", "2020-12-22 13:13:43.350531"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.354361"], ["updated_at", "2020-12-22 13:13:43.354361"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.357070"], ["updated_at", "2020-12-22 13:13:43.357070"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 754], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:13:43.360055"], ["id", 754]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.363700"], ["updated_at", "2020-12-22 13:13:43.363700"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.365689"], ["updated_at", "2020-12-22 13:13:43.365689"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 756], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:13:43.369084"], ["id", 756]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 756], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.374250"], ["updated_at", "2020-12-22 13:13:43.374250"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.376289"], ["updated_at", "2020-12-22 13:13:43.376289"], ["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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 758], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:13:43.382157"], ["id", 758]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 758], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:43.388728"], ["updated_at", "2020-12-22 13:13:43.388728"], ["synced_id", 1], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:43.392548"], ["updated_at", "2020-12-22 13:13:43.392548"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:43.395006"], ["updated_at", "2020-12-22 13:13:43.395006"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:43.397828"], ["updated_at", "2020-12-22 13:13:43.397828"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.402148"], ["updated_at", "2020-12-22 13:13:43.402148"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:13:43.411812"], ["updated_at", "2020-12-22 13:13:43.411812"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 765], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 765], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:13:43.415110"], ["id", 765]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 765], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:43.419252"], ["updated_at", "2020-12-22 13:13:43.419252"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.422628"], ["updated_at", "2020-12-22 13:13:43.422628"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:43.454692"], ["updated_at", "2020-12-22 13:13:43.454692"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:43.462790"], ["updated_at", "2020-12-22 13:13:43.462790"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:43.464807"], ["updated_at", "2020-12-22 13:13:43.464807"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.482311"], ["updated_at", "2020-12-22 13:13:43.482311"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.494338"], ["updated_at", "2020-12-22 13:13:43.494338"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.509275"], ["updated_at", "2020-12-22 13:13:43.509275"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.552884"], ["updated_at", "2020-12-22 13:13:43.552884"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.561609"], ["updated_at", "2020-12-22 13:13:43.561609"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.569469"], ["updated_at", "2020-12-22 13:13:43.569469"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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: 4.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:43.604422"], ["updated_at", "2020-12-22 13:13:43.604422"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (Duration: 0.0ms | Allocations: 5) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 17ms (Views: 9.8ms | ActiveRecord: 0.0ms | Allocations: 2248)  (0.2ms) ROLLBACK  (0.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 | Allocations: 121)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms | Allocations: 353)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 165)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (3.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.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", "2020-12-22 13:13:57.848573"], ["updated_at", "2020-12-22 13:13:57.848573"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 2.2ms | Allocations: 262) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 11ms (Views: 4.3ms | ActiveRecord: 0.0ms | Allocations: 1966)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 0.7ms | Allocations: 54) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms | Allocations: 429)  (0.1ms) ROLLBACK  (0.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]]  (0.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", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 13:13:57.922660"], ["updated_at", "2020-12-22 13:13:57.922660"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 6.2ms | Allocations: 6555)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:57.929576"], ["updated_at", "2020-12-22 13:13:57.929576"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.9ms | Allocations: 875)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (2.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:13:57.957930"], ["updated_at", "2020-12-22 13:13:57.957930"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 3.5ms | Allocations: 6468)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:57.968805"], ["updated_at", "2020-12-22 13:13:57.968805"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms | Allocations: 882)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 119)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 118)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:57.983326"], ["updated_at", "2020-12-22 13:13:57.983326"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:57.989707"], ["updated_at", "2020-12-22 13:13:57.989707"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:57.991752"], ["updated_at", "2020-12-22 13:13:57.991752"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:57.996522"], ["updated_at", "2020-12-22 13:13:57.996522"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:57.998769"], ["updated_at", "2020-12-22 13:13:57.998769"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.001974"], ["updated_at", "2020-12-22 13:13:58.001974"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.004373"], ["updated_at", "2020-12-22 13:13:58.004373"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:13:58.008314"], ["updated_at", "2020-12-22 13:13:58.008314"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:13:58.012907"], ["updated_at", "2020-12-22 13:13:58.012907"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.015204"], ["updated_at", "2020-12-22 13:13:58.015204"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:13:58.019343"], ["updated_at", "2020-12-22 13:13:58.019343"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.022498"], ["updated_at", "2020-12-22 13:13:58.022498"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:13:58.027348"], ["updated_at", "2020-12-22 13:13:58.027348"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.029581"], ["updated_at", "2020-12-22 13:13:58.029581"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.032875"], ["updated_at", "2020-12-22 13:13:58.032875"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.034928"], ["updated_at", "2020-12-22 13:13:58.034928"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 783], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:13:58.037925"], ["id", 783]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.042004"], ["updated_at", "2020-12-22 13:13:58.042004"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.044094"], ["updated_at", "2020-12-22 13:13:58.044094"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 785], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:13:58.046645"], ["id", 785]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 785], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.050360"], ["updated_at", "2020-12-22 13:13:58.050360"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.052511"], ["updated_at", "2020-12-22 13:13:58.052511"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 787], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:13:58.055498"], ["id", 787]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 787], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.060980"], ["updated_at", "2020-12-22 13:13:58.060980"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:13:58.100578"], ["updated_at", "2020-12-22 13:13:58.100578"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 789], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 789], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:13:58.107404"], ["id", 789]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 789], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.111585"], ["updated_at", "2020-12-22 13:13:58.111585"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.114410"], ["updated_at", "2020-12-22 13:13:58.114410"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.145584"], ["updated_at", "2020-12-22 13:13:58.145584"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.148759"], ["updated_at", "2020-12-22 13:13:58.148759"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:13:58.153193"], ["updated_at", "2020-12-22 13:13:58.153193"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 13:13:58.158322"], ["updated_at", "2020-12-22 13:13:58.158322"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729238"], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.161793"], ["updated_at", "2020-12-22 13:13:58.161793"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:13:58.186892"], ["updated_at", "2020-12-22 13:13:58.186892"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556438"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.190843"], ["updated_at", "2020-12-22 13:13:58.190843"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 794], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:13:58.207290"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 794]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.210642"], ["updated_at", "2020-12-22 13:13:58.210642"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists? (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists? (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.230276"], ["updated_at", "2020-12-22 13:13:58.230276"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.233586"], ["updated_at", "2020-12-22 13:13:58.233586"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.236988"], ["updated_at", "2020-12-22 13:13:58.236988"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.241243"], ["updated_at", "2020-12-22 13:13:58.241243"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.243302"], ["updated_at", "2020-12-22 13:13:58.243302"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.245051"], ["updated_at", "2020-12-22 13:13:58.245051"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.247284"], ["updated_at", "2020-12-22 13:13:58.247284"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:58.251474"], ["updated_at", "2020-12-22 13:13:58.251474"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:13:58.258792"], ["updated_at", "2020-12-22 13:13:58.258792"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:13:58.260325"], ["synced_id", 0], ["id", 821]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:58.266244"], ["updated_at", "2020-12-22 13:13:58.266244"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.269761"], ["updated_at", "2020-12-22 13:13:58.269761"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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", "2020-12-22 13:13:58.271654"], ["updated_at", "2020-12-22 13:13:58.271654"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 824], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:13:58.274895"], ["id", 824]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.278125"], ["updated_at", "2020-12-22 13:13:58.278125"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.280045"], ["updated_at", "2020-12-22 13:13:58.280045"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 826], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:13:58.282678"], ["id", 826]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 826], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.286341"], ["updated_at", "2020-12-22 13:13:58.286341"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.288339"], ["updated_at", "2020-12-22 13:13:58.288339"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 828], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:13:58.292007"], ["id", 828]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 828], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.295704"], ["updated_at", "2020-12-22 13:13:58.295704"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.297632"], ["updated_at", "2020-12-22 13:13:58.297632"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 830], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:13:58.300227"], ["id", 830]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.303356"], ["updated_at", "2020-12-22 13:13:58.303356"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.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", "2020-12-22 13:13:58.306931"], ["updated_at", "2020-12-22 13:13:58.306931"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (2.7ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.315864"], ["updated_at", "2020-12-22 13:13:58.315864"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:58.319226"], ["updated_at", "2020-12-22 13:13:58.319226"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.324907"], ["updated_at", "2020-12-22 13:13:58.324907"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:58.329353"], ["updated_at", "2020-12-22 13:13:58.329353"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:13:58.332688"], ["updated_at", "2020-12-22 13:13:58.332688"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:58.335652"], ["updated_at", "2020-12-22 13:13:58.335652"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:58.339147"], ["updated_at", "2020-12-22 13:13:58.339147"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:58.357056"], ["updated_at", "2020-12-22 13:13:58.357056"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:58.373737"], ["updated_at", "2020-12-22 13:13:58.373737"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:58.375438"], ["updated_at", "2020-12-22 13:13:58.375438"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:58.377154"], ["updated_at", "2020-12-22 13:13:58.377154"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:58.380866"], ["updated_at", "2020-12-22 13:13:58.380866"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729238"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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", "2020-12-22 13:13:58.383794"], ["updated_at", "2020-12-22 13:13:58.383794"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556438"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:13:58.401183"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 845]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:13:58.404560"], ["updated_at", "2020-12-22 13:13:58.404560"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:13:58.407873"], ["updated_at", "2020-12-22 13:13:58.407873"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 847], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 847], ["LIMIT", 1]] Account Update (0.2ms) 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", "2020-12-22 13:13:58.410628"], ["id", 847]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 847], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.420531"], ["updated_at", "2020-12-22 13:13:58.420531"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.432774"], ["updated_at", "2020-12-22 13:13:58.432774"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.441382"], ["updated_at", "2020-12-22 13:13:58.441382"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.451893"], ["updated_at", "2020-12-22 13:13:58.451893"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.459803"], ["updated_at", "2020-12-22 13:13:58.459803"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:13:58.466752"], ["updated_at", "2020-12-22 13:13:58.466752"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 11.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) 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]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:14:52.825648"], ["updated_at", "2020-12-22 13:14:52.825648"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 86ms (ActiveRecord: 18.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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]] SQL (0.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", "2020-12-22 13:14:52.838138"], ["updated_at", "2020-12-22 13:14:52.838138"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:52.854049"], ["updated_at", "2020-12-22 13:14:52.854049"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (2.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:14:52.896118"], ["updated_at", "2020-12-22 13:14:52.896118"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 23ms (ActiveRecord: 2.7ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 5ms (Views: 4.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:14:52.959491"], ["updated_at", "2020-12-22 13:14:52.959491"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:14:52.961433"], ["updated_at", "2020-12-22 13:14:52.961433"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:14:52.963371"], ["updated_at", "2020-12-22 13:14:52.963371"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:52.970690"], ["updated_at", "2020-12-22 13:14:52.970690"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:14:52.976782"], ["updated_at", "2020-12-22 13:14:52.976782"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:14:53.007694"], ["updated_at", "2020-12-22 13:14:53.007694"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:14:53.026366"], ["updated_at", "2020-12-22 13:14:53.026366"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.031679"], ["updated_at", "2020-12-22 13:14:53.031679"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729293"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.035681"], ["updated_at", "2020-12-22 13:14:53.035681"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556493"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 859], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:14:53.052905"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 859]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:14:53.056295"], ["updated_at", "2020-12-22 13:14:53.056295"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:14:53.064491"], ["updated_at", "2020-12-22 13:14:53.064491"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:14:53.065873"], ["synced_id", 0], ["id", 861]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.080484"], ["updated_at", "2020-12-22 13:14:53.080484"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.082415"], ["updated_at", "2020-12-22 13:14:53.082415"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 863], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.085809"], ["id", 863]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.089175"], ["updated_at", "2020-12-22 13:14:53.089175"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.090965"], ["updated_at", "2020-12-22 13:14:53.090965"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 865], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.093821"], ["id", 865]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 865], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.097558"], ["updated_at", "2020-12-22 13:14:53.097558"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.099478"], ["updated_at", "2020-12-22 13:14:53.099478"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 867], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.102850"], ["id", 867]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 867], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.106619"], ["updated_at", "2020-12-22 13:14:53.106619"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.108519"], ["updated_at", "2020-12-22 13:14:53.108519"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 869], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.111220"], ["id", 869]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.114477"], ["updated_at", "2020-12-22 13:14:53.114477"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.118878"], ["updated_at", "2020-12-22 13:14:53.118878"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.122462"], ["updated_at", "2020-12-22 13:14:53.122462"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.125108"], ["updated_at", "2020-12-22 13:14:53.125108"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.128621"], ["updated_at", "2020-12-22 13:14:53.128621"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.131270"], ["updated_at", "2020-12-22 13:14:53.131270"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.135025"], ["updated_at", "2020-12-22 13:14:53.135025"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.137484"], ["updated_at", "2020-12-22 13:14:53.137484"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (2.0ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.169111"], ["updated_at", "2020-12-22 13:14:53.169111"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 878], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 878], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 13:14:53.172171"], ["id", 878]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 878], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:14:53.176836"], ["updated_at", "2020-12-22 13:14:53.176836"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.180738"], ["updated_at", "2020-12-22 13:14:53.180738"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (3.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.188655"], ["updated_at", "2020-12-22 13:14:53.188655"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:14:53.195160"], ["updated_at", "2020-12-22 13:14:53.195160"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 804], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 804], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.199865"], ["id", 804]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 804], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.204722"], ["updated_at", "2020-12-22 13:14:53.204722"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.208996"], ["updated_at", "2020-12-22 13:14:53.208996"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.211902"], ["updated_at", "2020-12-22 13:14:53.211902"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.216196"], ["updated_at", "2020-12-22 13:14:53.216196"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.226143"], ["updated_at", "2020-12-22 13:14:53.226143"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.228541"], ["updated_at", "2020-12-22 13:14:53.228541"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.235187"], ["updated_at", "2020-12-22 13:14:53.235187"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.237102"], ["updated_at", "2020-12-22 13:14:53.237102"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:14:53.240852"], ["updated_at", "2020-12-22 13:14:53.240852"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:14:53.245232"], ["updated_at", "2020-12-22 13:14:53.245232"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.247829"], ["updated_at", "2020-12-22 13:14:53.247829"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:14:53.253019"], ["updated_at", "2020-12-22 13:14:53.253019"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.255117"], ["updated_at", "2020-12-22 13:14:53.255117"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:14:53.259302"], ["updated_at", "2020-12-22 13:14:53.259302"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.261724"], ["updated_at", "2020-12-22 13:14:53.261724"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.265308"], ["updated_at", "2020-12-22 13:14:53.265308"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.267607"], ["updated_at", "2020-12-22 13:14:53.267607"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 818], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.271275"], ["id", 818]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.275481"], ["updated_at", "2020-12-22 13:14:53.275481"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.277466"], ["updated_at", "2020-12-22 13:14:53.277466"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 820], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.280607"], ["id", 820]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 820], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.285537"], ["updated_at", "2020-12-22 13:14:53.285537"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.287706"], ["updated_at", "2020-12-22 13:14:53.287706"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 822], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.290710"], ["id", 822]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 822], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.294979"], ["updated_at", "2020-12-22 13:14:53.294979"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.298713"], ["updated_at", "2020-12-22 13:14:53.298713"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "example.test"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.320558"], ["updated_at", "2020-12-22 13:14:53.320558"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.322832"], ["updated_at", "2020-12-22 13:14:53.322832"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.324872"], ["updated_at", "2020-12-22 13:14:53.324872"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.327092"], ["updated_at", "2020-12-22 13:14:53.327092"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:14:53.332115"], ["updated_at", "2020-12-22 13:14:53.332115"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556493"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.336170"], ["updated_at", "2020-12-22 13:14:53.336170"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 829], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:14:53.353403"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 829]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:14:53.356943"], ["updated_at", "2020-12-22 13:14:53.356943"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729293"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.360478"], ["updated_at", "2020-12-22 13:14:53.360478"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.365115"], ["updated_at", "2020-12-22 13:14:53.365115"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:14:53.373675"], ["updated_at", "2020-12-22 13:14:53.373675"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.379975"], ["updated_at", "2020-12-22 13:14:53.379975"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:14:53.382097"], ["updated_at", "2020-12-22 13:14:53.382097"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.388382"], ["updated_at", "2020-12-22 13:14:53.388382"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.393731"], ["updated_at", "2020-12-22 13:14:53.393731"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.404060"], ["updated_at", "2020-12-22 13:14:53.404060"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.418459"], ["updated_at", "2020-12-22 13:14:53.418459"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.426796"], ["updated_at", "2020-12-22 13:14:53.426796"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.441026"], ["updated_at", "2020-12-22 13:14:53.441026"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:14:53.449315"], ["updated_at", "2020-12-22 13:14:53.449315"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (6.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]] SQL (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:05.680152"], ["updated_at", "2020-12-22 13:15:05.680152"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (3.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:05.696207"], ["updated_at", "2020-12-22 13:15:05.696207"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:05.945264"], ["updated_at", "2020-12-22 13:15:05.945264"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:05.949057"], ["updated_at", "2020-12-22 13:15:05.949057"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:05.953003"], ["updated_at", "2020-12-22 13:15:05.953003"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:05.957374"], ["updated_at", "2020-12-22 13:15:05.957374"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:05.959393"], ["updated_at", "2020-12-22 13:15:05.959393"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:05.961404"], ["updated_at", "2020-12-22 13:15:05.961404"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:05.964273"], ["updated_at", "2020-12-22 13:15:05.964273"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:05.968846"], ["updated_at", "2020-12-22 13:15:05.968846"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:15:05.985582"], ["updated_at", "2020-12-22 13:15:05.985582"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 840], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 840], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:05.995079"], ["id", 840]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 840], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.000308"], ["updated_at", "2020-12-22 13:15:06.000308"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.003560"], ["updated_at", "2020-12-22 13:15:06.003560"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.010836"], ["updated_at", "2020-12-22 13:15:06.010836"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.039006"], ["updated_at", "2020-12-22 13:15:06.039006"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.041926"], ["updated_at", "2020-12-22 13:15:06.041926"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.046456"], ["updated_at", "2020-12-22 13:15:06.046456"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:15:06.051535"], ["updated_at", "2020-12-22 13:15:06.051535"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.053624"], ["updated_at", "2020-12-22 13:15:06.053624"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:15:06.058656"], ["updated_at", "2020-12-22 13:15:06.058656"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.060827"], ["updated_at", "2020-12-22 13:15:06.060827"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:15:06.067673"], ["updated_at", "2020-12-22 13:15:06.067673"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.070112"], ["updated_at", "2020-12-22 13:15:06.070112"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.074114"], ["updated_at", "2020-12-22 13:15:06.074114"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.076211"], ["updated_at", "2020-12-22 13:15:06.076211"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 851], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.080657"], ["id", 851]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.084451"], ["updated_at", "2020-12-22 13:15:06.084451"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.087206"], ["updated_at", "2020-12-22 13:15:06.087206"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 853], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.090843"], ["id", 853]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 853], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:15:06.095005"], ["updated_at", "2020-12-22 13:15:06.095005"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.098096"], ["updated_at", "2020-12-22 13:15:06.098096"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 855], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.100690"], ["id", 855]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 855], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.106044"], ["updated_at", "2020-12-22 13:15:06.106044"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.108248"], ["updated_at", "2020-12-22 13:15:06.108248"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:15:06.115603"], ["updated_at", "2020-12-22 13:15:06.115603"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556506"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.118624"], ["updated_at", "2020-12-22 13:15:06.118624"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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", 859], ["host", "example.test"], ["LIMIT", 1]] SQL (0.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:15:06.140958"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 859]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:15:06.147972"], ["updated_at", "2020-12-22 13:15:06.147972"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729306"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) 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.3ms) 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]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.156011"], ["updated_at", "2020-12-22 13:15:06.156011"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:15:06.161908"], ["updated_at", "2020-12-22 13:15:06.161908"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (3.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:06.180236"], ["updated_at", "2020-12-22 13:15:06.180236"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:06.182743"], ["updated_at", "2020-12-22 13:15:06.182743"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:06.184770"], ["updated_at", "2020-12-22 13:15:06.184770"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:15:06.195154"], ["updated_at", "2020-12-22 13:15:06.195154"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:15:06.197108"], ["synced_id", 0], ["id", 883]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.204368"], ["updated_at", "2020-12-22 13:15:06.204368"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.206259"], ["updated_at", "2020-12-22 13:15:06.206259"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 885], ["LIMIT", 1]] SQL (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", "2020-12-22 13:15:06.209827"], ["id", 885]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.214486"], ["updated_at", "2020-12-22 13:15:06.214486"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.216375"], ["updated_at", "2020-12-22 13:15:06.216375"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 887], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.219891"], ["id", 887]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.224411"], ["updated_at", "2020-12-22 13:15:06.224411"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.226749"], ["updated_at", "2020-12-22 13:15:06.226749"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.3ms) 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.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 889], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.231185"], ["id", 889]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 889], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.238099"], ["updated_at", "2020-12-22 13:15:06.238099"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.240263"], ["updated_at", "2020-12-22 13:15:06.240263"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 891], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.243692"], ["id", 891]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 891], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.248556"], ["updated_at", "2020-12-22 13:15:06.248556"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.252026"], ["updated_at", "2020-12-22 13:15:06.252026"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.255879"], ["updated_at", "2020-12-22 13:15:06.255879"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.258970"], ["updated_at", "2020-12-22 13:15:06.258970"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.263454"], ["updated_at", "2020-12-22 13:15:06.263454"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.268911"], ["updated_at", "2020-12-22 13:15:06.268911"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.272801"], ["updated_at", "2020-12-22 13:15:06.272801"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.275567"], ["updated_at", "2020-12-22 13:15:06.275567"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:06.280187"], ["updated_at", "2020-12-22 13:15:06.280187"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:06.285344"], ["updated_at", "2020-12-22 13:15:06.285344"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:06.327076"], ["updated_at", "2020-12-22 13:15:06.327076"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:06.366297"], ["updated_at", "2020-12-22 13:15:06.366297"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.369543"], ["updated_at", "2020-12-22 13:15:06.369543"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729306"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.373053"], ["updated_at", "2020-12-22 13:15:06.373053"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556506"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 905], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:15:06.388890"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 905]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.391886"], ["updated_at", "2020-12-22 13:15:06.391886"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 906], ["LIMIT", 1]]  (0.1ms) 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", 906], ["LIMIT", 1]] SQL (0.5ms) 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", "2020-12-22 13:15:06.395439"], ["id", 906]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 906], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.399867"], ["updated_at", "2020-12-22 13:15:06.399867"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.404841"], ["updated_at", "2020-12-22 13:15:06.404841"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.419475"], ["updated_at", "2020-12-22 13:15:06.419475"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:06.421678"], ["updated_at", "2020-12-22 13:15:06.421678"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:06.430610"], ["updated_at", "2020-12-22 13:15:06.430610"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 5ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.458475"], ["updated_at", "2020-12-22 13:15:06.458475"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.474327"], ["updated_at", "2020-12-22 13:15:06.474327"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.489831"], ["updated_at", "2020-12-22 13:15:06.489831"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.502267"], ["updated_at", "2020-12-22 13:15:06.502267"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.514940"], ["updated_at", "2020-12-22 13:15:06.514940"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:06.523501"], ["updated_at", "2020-12-22 13:15:06.523501"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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]] SQL (0.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", "2020-12-22 13:15:06.570647"], ["updated_at", "2020-12-22 13:15:06.570647"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.578352"], ["updated_at", "2020-12-22 13:15:06.578352"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:15:06.591209"], ["updated_at", "2020-12-22 13:15:06.591209"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:15:06.602798"], ["updated_at", "2020-12-22 13:15:06.602798"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 2.5ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.4ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.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", "2020-12-22 13:15:23.083556"], ["updated_at", "2020-12-22 13:15:23.083556"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.396153"], ["updated_at", "2020-12-22 13:15:23.396153"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.417868"], ["updated_at", "2020-12-22 13:15:23.417868"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.426823"], ["updated_at", "2020-12-22 13:15:23.426823"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.438762"], ["updated_at", "2020-12-22 13:15:23.438762"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.450031"], ["updated_at", "2020-12-22 13:15:23.450031"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 8.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) 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]]  (0.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", "2020-12-22 13:15:23.523281"], ["updated_at", "2020-12-22 13:15:23.523281"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 17ms (ActiveRecord: 6.3ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:23.532431"], ["updated_at", "2020-12-22 13:15:23.532431"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.4ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (3.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:15:23.564898"], ["updated_at", "2020-12-22 13:15:23.564898"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 3.3ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:23.576912"], ["updated_at", "2020-12-22 13:15:23.576912"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:23.588542"], ["updated_at", "2020-12-22 13:15:23.588542"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:23.591505"], ["updated_at", "2020-12-22 13:15:23.591505"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:23.599245"], ["updated_at", "2020-12-22 13:15:23.599245"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729323"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:23.605036"], ["updated_at", "2020-12-22 13:15:23.605036"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556523"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 918], ["LIMIT", 1]] Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:15:23.637512"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 918]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:23.641143"], ["updated_at", "2020-12-22 13:15:23.641143"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:23.643006"], ["updated_at", "2020-12-22 13:15:23.643006"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:23.645173"], ["updated_at", "2020-12-22 13:15:23.645173"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:23.649741"], ["updated_at", "2020-12-22 13:15:23.649741"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 922], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 922], ["LIMIT", 1]] Account Update (0.2ms) 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", "2020-12-22 13:15:23.652985"], ["id", 922]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 922], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.657149"], ["updated_at", "2020-12-22 13:15:23.657149"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.659301"], ["updated_at", "2020-12-22 13:15:23.659301"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 924], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:15:23.661899"], ["id", 924]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 924], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.665989"], ["updated_at", "2020-12-22 13:15:23.665989"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.667918"], ["updated_at", "2020-12-22 13:15:23.667918"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 926], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:15:23.670766"], ["id", 926]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 926], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.674424"], ["updated_at", "2020-12-22 13:15:23.674424"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.676310"], ["updated_at", "2020-12-22 13:15:23.676310"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 928], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:15:23.679475"], ["id", 928]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.682658"], ["updated_at", "2020-12-22 13:15:23.682658"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.684503"], ["updated_at", "2020-12-22 13:15:23.684503"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 930], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:15:23.687108"], ["id", 930]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.690222"], ["updated_at", "2020-12-22 13:15:23.690222"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:23.693218"], ["updated_at", "2020-12-22 13:15:23.693218"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.697219"], ["updated_at", "2020-12-22 13:15:23.697219"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:23.699667"], ["updated_at", "2020-12-22 13:15:23.699667"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.702962"], ["updated_at", "2020-12-22 13:15:23.702962"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:23.705729"], ["updated_at", "2020-12-22 13:15:23.705729"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.709386"], ["updated_at", "2020-12-22 13:15:23.709386"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:23.713832"], ["updated_at", "2020-12-22 13:15:23.713832"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:23.717162"], ["updated_at", "2020-12-22 13:15:23.717162"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:23.720330"], ["updated_at", "2020-12-22 13:15:23.720330"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:23.742139"], ["updated_at", "2020-12-22 13:15:23.742139"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:15:23.800231"], ["updated_at", "2020-12-22 13:15:23.800231"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:15:23.802170"], ["synced_id", 0], ["id", 942]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:23.812960"], ["updated_at", "2020-12-22 13:15:23.812960"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.819467"], ["updated_at", "2020-12-22 13:15:23.819467"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.822319"], ["updated_at", "2020-12-22 13:15:23.822319"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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", "2020-12-22 13:15:23.830220"], ["updated_at", "2020-12-22 13:15:23.830220"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.885219"], ["updated_at", "2020-12-22 13:15:23.885219"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.888018"], ["updated_at", "2020-12-22 13:15:23.888018"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.892218"], ["updated_at", "2020-12-22 13:15:23.892218"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.895138"], ["updated_at", "2020-12-22 13:15:23.895138"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 870], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:15:23.899413"], ["id", 870]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.903740"], ["updated_at", "2020-12-22 13:15:23.903740"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.906065"], ["updated_at", "2020-12-22 13:15:23.906065"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 872], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:15:23.909247"], ["id", 872]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 872], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.914680"], ["updated_at", "2020-12-22 13:15:23.914680"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.917467"], ["updated_at", "2020-12-22 13:15:23.917467"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 874], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:15:23.920792"], ["id", 874]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 874], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "2020-12-22 13:15:23.925974"], ["updated_at", "2020-12-22 13:15:23.925974"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.929917"], ["updated_at", "2020-12-22 13:15:23.929917"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:15:23.934938"], ["updated_at", "2020-12-22 13:15:23.934938"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:15:23.940700"], ["updated_at", "2020-12-22 13:15:23.940700"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.943172"], ["updated_at", "2020-12-22 13:15:23.943172"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:15:23.947770"], ["updated_at", "2020-12-22 13:15:23.947770"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:23.950462"], ["updated_at", "2020-12-22 13:15:23.950462"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:15:23.954765"], ["updated_at", "2020-12-22 13:15:23.954765"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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", "2020-12-22 13:15:23.957100"], ["updated_at", "2020-12-22 13:15:23.957100"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:15:23.988605"], ["updated_at", "2020-12-22 13:15:23.988605"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 885], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 885], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:15:23.992626"], ["id", 885]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 885], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:23.998789"], ["updated_at", "2020-12-22 13:15:23.998789"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:24.002350"], ["updated_at", "2020-12-22 13:15:24.002350"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:24.007554"], ["updated_at", "2020-12-22 13:15:24.007554"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:24.011874"], ["updated_at", "2020-12-22 13:15:24.011874"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:24.022599"], ["updated_at", "2020-12-22 13:15:24.022599"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:24.024933"], ["updated_at", "2020-12-22 13:15:24.024933"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:24.026789"], ["updated_at", "2020-12-22 13:15:24.026789"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:24.029065"], ["updated_at", "2020-12-22 13:15:24.029065"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:24.035400"], ["updated_at", "2020-12-22 13:15:24.035400"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:24.039159"], ["updated_at", "2020-12-22 13:15:24.039159"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:24.042589"], ["updated_at", "2020-12-22 13:15:24.042589"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:15:24.046807"], ["updated_at", "2020-12-22 13:15:24.046807"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:15:24.052405"], ["updated_at", "2020-12-22 13:15:24.052405"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556524"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:24.055644"], ["updated_at", "2020-12-22 13:15:24.055644"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 894], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:15:24.076485"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 894]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:15:24.081758"], ["updated_at", "2020-12-22 13:15:24.081758"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729324"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:24.086502"], ["updated_at", "2020-12-22 13:15:24.086502"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:24.092742"], ["updated_at", "2020-12-22 13:15:24.092742"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) 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", "2020-12-22 13:15:24.096635"], ["updated_at", "2020-12-22 13:15:24.096635"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (3.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.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", "2020-12-22 13:15:37.808221"], ["updated_at", "2020-12-22 13:15:37.808221"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 2.2ms | Allocations: 264) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 22ms (Views: 11.9ms | ActiveRecord: 0.0ms | Allocations: 3646)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 0.1ms | Allocations: 54) 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 | Allocations: 426)  (0.1ms) ROLLBACK  (0.1ms) 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]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.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", "2020-12-22 13:15:37.883625"], ["updated_at", "2020-12-22 13:15:37.883625"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 17ms (ActiveRecord: 6.5ms | Allocations: 6574)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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.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", "2020-12-22 13:15:37.893866"], ["updated_at", "2020-12-22 13:15:37.893866"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.4ms | Allocations: 883)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (3.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:15:37.918491"], ["updated_at", "2020-12-22 13:15:37.918491"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 13ms (ActiveRecord: 2.8ms | Allocations: 6468)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:37.927668"], ["updated_at", "2020-12-22 13:15:37.927668"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms | Allocations: 882)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 119)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 118)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.941121"], ["updated_at", "2020-12-22 13:15:37.941121"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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", "test.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.943772"], ["updated_at", "2020-12-22 13:15:37.943772"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:37.948579"], ["updated_at", "2020-12-22 13:15:37.948579"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:37.953427"], ["updated_at", "2020-12-22 13:15:37.953427"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.956633"], ["updated_at", "2020-12-22 13:15:37.956633"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:37.959542"], ["updated_at", "2020-12-22 13:15:37.959542"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.962929"], ["updated_at", "2020-12-22 13:15:37.962929"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:37.965359"], ["updated_at", "2020-12-22 13:15:37.965359"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.968417"], ["updated_at", "2020-12-22 13:15:37.968417"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:37.971719"], ["updated_at", "2020-12-22 13:15:37.971719"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.974766"], ["updated_at", "2020-12-22 13:15:37.974766"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:37.977042"], ["updated_at", "2020-12-22 13:15:37.977042"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.980142"], ["updated_at", "2020-12-22 13:15:37.980142"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.981853"], ["updated_at", "2020-12-22 13:15:37.981853"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 958], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:15:37.984535"], ["id", 958]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 958], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.989294"], ["updated_at", "2020-12-22 13:15:37.989294"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.991319"], ["updated_at", "2020-12-22 13:15:37.991319"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 960], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:15:37.993714"], ["id", 960]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 960], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.997515"], ["updated_at", "2020-12-22 13:15:37.997515"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:37.999256"], ["updated_at", "2020-12-22 13:15:37.999256"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 962], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:15:38.001752"], ["id", 962]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:38.005361"], ["updated_at", "2020-12-22 13:15:38.005361"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:38.007838"], ["updated_at", "2020-12-22 13:15:38.007838"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 964], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:15:38.010612"], ["id", 964]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:15:38.015180"], ["updated_at", "2020-12-22 13:15:38.015180"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:15:38.016639"], ["synced_id", 0], ["id", 965]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:38.031621"], ["updated_at", "2020-12-22 13:15:38.031621"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 966], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 966], ["LIMIT", 1]] Account Update (0.2ms) 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", "2020-12-22 13:15:38.038177"], ["id", 966]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 966], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:38.042267"], ["updated_at", "2020-12-22 13:15:38.042267"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:38.045370"], ["updated_at", "2020-12-22 13:15:38.045370"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:38.078599"], ["updated_at", "2020-12-22 13:15:38.078599"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:38.097824"], ["updated_at", "2020-12-22 13:15:38.097824"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:38.099776"], ["updated_at", "2020-12-22 13:15:38.099776"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:15:38.101822"], ["updated_at", "2020-12-22 13:15:38.101822"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:38.142341"], ["updated_at", "2020-12-22 13:15:38.142341"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729338"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:38.145805"], ["updated_at", "2020-12-22 13:15:38.145805"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556538"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:15:38.187570"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 974]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:15:38.191031"], ["updated_at", "2020-12-22 13:15:38.191031"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 3.1ms | ActiveRecord: 0.0ms | Allocations: 558)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 165)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (Duration: 0.0ms | Allocations: 3) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms | Allocations: 365)  (0.2ms) ROLLBACK  (0.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 | Allocations: 94)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.225479"], ["updated_at", "2020-12-22 13:15:38.225479"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.238228"], ["updated_at", "2020-12-22 13:15:38.238228"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.251500"], ["updated_at", "2020-12-22 13:15:38.251500"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.260677"], ["updated_at", "2020-12-22 13:15:38.260677"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.272464"], ["updated_at", "2020-12-22 13:15:38.272464"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.279703"], ["updated_at", "2020-12-22 13:15:38.279703"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:38.295946"], ["updated_at", "2020-12-22 13:15:38.295946"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.299097"], ["updated_at", "2020-12-22 13:15:38.299097"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:15:38.303411"], ["updated_at", "2020-12-22 13:15:38.303411"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729338"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.306643"], ["updated_at", "2020-12-22 13:15:38.306643"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:15:38.310467"], ["updated_at", "2020-12-22 13:15:38.310467"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556538"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.313631"], ["updated_at", "2020-12-22 13:15:38.313631"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 902], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:15:38.329890"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 902]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:38.333230"], ["updated_at", "2020-12-22 13:15:38.333230"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:38.334997"], ["updated_at", "2020-12-22 13:15:38.334997"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:38.337264"], ["updated_at", "2020-12-22 13:15:38.337264"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:38.339512"], ["updated_at", "2020-12-22 13:15:38.339512"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:15:38.343235"], ["updated_at", "2020-12-22 13:15:38.343235"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:38.346616"], ["updated_at", "2020-12-22 13:15:38.346616"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.349435"], ["updated_at", "2020-12-22 13:15:38.349435"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:15:38.367231"], ["updated_at", "2020-12-22 13:15:38.367231"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.370312"], ["updated_at", "2020-12-22 13:15:38.370312"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.373656"], ["updated_at", "2020-12-22 13:15:38.373656"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.378196"], ["updated_at", "2020-12-22 13:15:38.378196"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.382359"], ["updated_at", "2020-12-22 13:15:38.382359"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (8.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.384208"], ["updated_at", "2020-12-22 13:15:38.384208"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.397025"], ["updated_at", "2020-12-22 13:15:38.397025"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.399262"], ["updated_at", "2020-12-22 13:15:38.399262"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:15:38.404116"], ["updated_at", "2020-12-22 13:15:38.404116"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:15:38.408479"], ["updated_at", "2020-12-22 13:15:38.408479"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.410361"], ["updated_at", "2020-12-22 13:15:38.410361"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:15:38.414604"], ["updated_at", "2020-12-22 13:15:38.414604"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.416587"], ["updated_at", "2020-12-22 13:15:38.416587"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:15:38.421135"], ["updated_at", "2020-12-22 13:15:38.421135"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.423135"], ["updated_at", "2020-12-22 13:15:38.423135"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.426485"], ["updated_at", "2020-12-22 13:15:38.426485"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.428323"], ["updated_at", "2020-12-22 13:15:38.428323"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 921], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:15:38.431291"], ["id", 921]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.434506"], ["updated_at", "2020-12-22 13:15:38.434506"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.436928"], ["updated_at", "2020-12-22 13:15:38.436928"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 923], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:15:38.440009"], ["id", 923]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 923], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.443974"], ["updated_at", "2020-12-22 13:15:38.443974"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.445853"], ["updated_at", "2020-12-22 13:15:38.445853"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 925], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:15:38.448516"], ["id", 925]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 925], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:15:38.452666"], ["updated_at", "2020-12-22 13:15:38.452666"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists? (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists? (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:15:38.461114"], ["updated_at", "2020-12-22 13:15:38.461114"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 928], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 928], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:15:38.463832"], ["id", 928]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 928], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 5ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.6ms) 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.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]] SQL (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", "2020-12-22 13:22:10.759665"], ["updated_at", "2020-12-22 13:22:10.759665"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 77ms (ActiveRecord: 20.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:10.768053"], ["updated_at", "2020-12-22 13:22:10.768053"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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]] SQL (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", "2020-12-22 13:22:10.780315"], ["updated_at", "2020-12-22 13:22:10.780315"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 2.5ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (2.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:22:10.809405"], ["updated_at", "2020-12-22 13:22:10.809405"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 12ms (ActiveRecord: 2.5ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 13ms (Views: 10.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:10.847633"], ["updated_at", "2020-12-22 13:22:10.847633"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:10.872077"], ["updated_at", "2020-12-22 13:22:10.872077"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.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 (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) 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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:10.887905"], ["updated_at", "2020-12-22 13:22:10.887905"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:10.898649"], ["updated_at", "2020-12-22 13:22:10.898649"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:10.908270"], ["updated_at", "2020-12-22 13:22:10.908270"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:10.922286"], ["updated_at", "2020-12-22 13:22:10.922286"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:10.931265"], ["updated_at", "2020-12-22 13:22:10.931265"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.host"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:10.942788"], ["updated_at", "2020-12-22 13:22:10.942788"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:10.945345"], ["updated_at", "2020-12-22 13:22:10.945345"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:22:10.951481"], ["updated_at", "2020-12-22 13:22:10.951481"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:22:10.957585"], ["updated_at", "2020-12-22 13:22:10.957585"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:22:10.960076"], ["updated_at", "2020-12-22 13:22:10.960076"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:22:10.961893"], ["updated_at", "2020-12-22 13:22:10.961893"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:22:10.966096"], ["updated_at", "2020-12-22 13:22:10.966096"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:10.972181"], ["updated_at", "2020-12-22 13:22:10.972181"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:10.979705"], ["updated_at", "2020-12-22 13:22:10.979705"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:10.982586"], ["updated_at", "2020-12-22 13:22:10.982586"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 986], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:10.987129"], ["id", 986]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:10.990984"], ["updated_at", "2020-12-22 13:22:10.990984"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (41.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:10.993859"], ["updated_at", "2020-12-22 13:22:10.993859"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.9ms) RELEASE SAVEPOINT active_record_1 Account Load (6.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 (9.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 988], ["LIMIT", 1]] SQL (3.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", "2020-12-22 13:22:11.062536"], ["id", 988]]  (2.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 988], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (1.2ms) BEGIN  (0.2ms) 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]] SQL (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.080333"], ["updated_at", "2020-12-22 13:22:11.080333"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (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]] SQL (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.090622"], ["updated_at", "2020-12-22 13:22:11.090622"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) 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", 990], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.096786"], ["id", 990]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 990], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.103266"], ["updated_at", "2020-12-22 13:22:11.103266"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.106745"], ["updated_at", "2020-12-22 13:22:11.106745"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) 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", 992], ["LIMIT", 1]] SQL (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", "2020-12-22 13:22:11.114533"], ["id", 992]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.121561"], ["updated_at", "2020-12-22 13:22:11.121561"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.126507"], ["updated_at", "2020-12-22 13:22:11.126507"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.133150"], ["updated_at", "2020-12-22 13:22:11.133150"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.138104"], ["updated_at", "2020-12-22 13:22:11.138104"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.141576"], ["updated_at", "2020-12-22 13:22:11.141576"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.144910"], ["updated_at", "2020-12-22 13:22:11.144910"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.148634"], ["updated_at", "2020-12-22 13:22:11.148634"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.151513"], ["updated_at", "2020-12-22 13:22:11.151513"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.155294"], ["updated_at", "2020-12-22 13:22:11.155294"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1001], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1001], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 13:22:11.158301"], ["id", 1001]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1001], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:22:11.163350"], ["updated_at", "2020-12-22 13:22:11.163350"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:22:11.167612"], ["updated_at", "2020-12-22 13:22:11.167612"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:22:11.220237"], ["updated_at", "2020-12-22 13:22:11.220237"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.272251"], ["updated_at", "2020-12-22 13:22:11.272251"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556931"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1005], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:22:11.303805"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1005]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.307007"], ["updated_at", "2020-12-22 13:22:11.307007"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729731"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:22:11.315294"], ["updated_at", "2020-12-22 13:22:11.315294"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:22:11.318066"], ["synced_id", 0], ["id", 1007]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "example.test"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.338908"], ["updated_at", "2020-12-22 13:22:11.338908"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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", 2], ["host", "example.test"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.343831"], ["updated_at", "2020-12-22 13:22:11.343831"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.347281"], ["updated_at", "2020-12-22 13:22:11.347281"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.350999"], ["updated_at", "2020-12-22 13:22:11.350999"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.354699"], ["updated_at", "2020-12-22 13:22:11.354699"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.364899"], ["updated_at", "2020-12-22 13:22:11.364899"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.369079"], ["updated_at", "2020-12-22 13:22:11.369079"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.373197"], ["updated_at", "2020-12-22 13:22:11.373197"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.377477"], ["updated_at", "2020-12-22 13:22:11.377477"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:22:11.400619"], ["updated_at", "2020-12-22 13:22:11.400619"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729731"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.404428"], ["updated_at", "2020-12-22 13:22:11.404428"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:22:11.409127"], ["updated_at", "2020-12-22 13:22:11.409127"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608556931"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.412101"], ["updated_at", "2020-12-22 13:22:11.412101"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 940], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.431565"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 940]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:22:11.435298"], ["updated_at", "2020-12-22 13:22:11.435298"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.439095"], ["updated_at", "2020-12-22 13:22:11.439095"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.442304"], ["updated_at", "2020-12-22 13:22:11.442304"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.446689"], ["updated_at", "2020-12-22 13:22:11.446689"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:22:11.448993"], ["updated_at", "2020-12-22 13:22:11.448993"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" 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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:22:11.456328"], ["updated_at", "2020-12-22 13:22:11.456328"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.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]] SQL (0.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", "2020-12-22 13:22:11.466947"], ["updated_at", "2020-12-22 13:22:11.466947"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.472118"], ["updated_at", "2020-12-22 13:22:11.472118"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:22:11.477900"], ["updated_at", "2020-12-22 13:22:11.477900"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.480002"], ["updated_at", "2020-12-22 13:22:11.480002"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:22:11.484435"], ["updated_at", "2020-12-22 13:22:11.484435"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.486829"], ["updated_at", "2020-12-22 13:22:11.486829"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.489957"], ["updated_at", "2020-12-22 13:22:11.489957"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.492374"], ["updated_at", "2020-12-22 13:22:11.492374"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 951], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.495399"], ["id", 951]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.500242"], ["updated_at", "2020-12-22 13:22:11.500242"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.502522"], ["updated_at", "2020-12-22 13:22:11.502522"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 953], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.505270"], ["id", 953]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 953], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.509856"], ["updated_at", "2020-12-22 13:22:11.509856"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.511771"], ["updated_at", "2020-12-22 13:22:11.511771"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 955], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.514247"], ["id", 955]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 955], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.518861"], ["updated_at", "2020-12-22 13:22:11.518861"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.520825"], ["updated_at", "2020-12-22 13:22:11.520825"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:22:11.528531"], ["updated_at", "2020-12-22 13:22:11.528531"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:22:11.533592"], ["updated_at", "2020-12-22 13:22:11.533592"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:22:11.537121"], ["updated_at", "2020-12-22 13:22:11.537121"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 960], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 960], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:22:11.539827"], ["id", 960]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 960], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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: 3.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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)  (0.4ms) ROLLBACK  (0.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 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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]] SQL (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:23:48.951344"], ["updated_at", "2020-12-22 13:23:48.951344"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:23:49.434988"], ["updated_at", "2020-12-22 13:23:49.434988"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:23:49.438187"], ["updated_at", "2020-12-22 13:23:49.438187"], ["synced_id", 2]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:23:49.441346"], ["updated_at", "2020-12-22 13:23:49.441346"], ["synced_id", 3]]  (0.1ms) 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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:49.457875"], ["updated_at", "2020-12-22 13:23:49.457875"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1012], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1012], ["LIMIT", 1]] SQL (1.5ms) 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", "2020-12-22 13:23:49.476886"], ["id", 1012]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1012], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:49.486828"], ["updated_at", "2020-12-22 13:23:49.486828"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (1.0ms) BEGIN Account Load (1.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:23:49.587084"], ["updated_at", "2020-12-22 13:23:49.587084"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:23:49.589321"], ["synced_id", 0], ["id", 1014]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.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]] SQL (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", "2020-12-22 13:23:49.632367"], ["updated_at", "2020-12-22 13:23:49.632367"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729829"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:49.640288"], ["updated_at", "2020-12-22 13:23:49.640288"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557029"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1016], ["LIMIT", 1]] SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:23:49.717821"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1016]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:23:49.723231"], ["updated_at", "2020-12-22 13:23:49.723231"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:23:49.727977"], ["updated_at", "2020-12-22 13:23:49.727977"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:23:49.758594"], ["updated_at", "2020-12-22 13:23:49.758594"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.839731"], ["updated_at", "2020-12-22 13:23:49.839731"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:49.843618"], ["updated_at", "2020-12-22 13:23:49.843618"], ["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  (0.6ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.854406"], ["updated_at", "2020-12-22 13:23:49.854406"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:49.858065"], ["updated_at", "2020-12-22 13:23:49.858065"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.863327"], ["updated_at", "2020-12-22 13:23:49.863327"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:49.870692"], ["updated_at", "2020-12-22 13:23:49.870692"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.874799"], ["updated_at", "2020-12-22 13:23:49.874799"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:23:49.878557"], ["updated_at", "2020-12-22 13:23:49.878557"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.890160"], ["updated_at", "2020-12-22 13:23:49.890160"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.892665"], ["updated_at", "2020-12-22 13:23:49.892665"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 1029], ["LIMIT", 1]] SQL (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", "2020-12-22 13:23:49.897942"], ["id", 1029]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.905197"], ["updated_at", "2020-12-22 13:23:49.905197"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.907897"], ["updated_at", "2020-12-22 13:23:49.907897"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 1031], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:49.912521"], ["id", 1031]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.923385"], ["updated_at", "2020-12-22 13:23:49.923385"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.930574"], ["updated_at", "2020-12-22 13:23:49.930574"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.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.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1033], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:49.937827"], ["id", 1033]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1033], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.945591"], ["updated_at", "2020-12-22 13:23:49.945591"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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]] SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:49.950638"], ["updated_at", "2020-12-22 13:23:49.950638"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 1035], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:49.959259"], ["id", 1035]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1035], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 16ms (Views: 15.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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: 0.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 8ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:50.123937"], ["updated_at", "2020-12-22 13:23:50.123937"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 25ms (ActiveRecord: 1.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:50.132480"], ["updated_at", "2020-12-22 13:23:50.132480"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 1.1ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:50.144221"], ["updated_at", "2020-12-22 13:23:50.144221"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.5ms) SELECT COUNT(*) FROM "accounts" Account Load (2.7ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (4.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:23:50.178861"], ["updated_at", "2020-12-22 13:23:50.178861"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 18ms (ActiveRecord: 3.9ms)  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 3.4ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.210766"], ["updated_at", "2020-12-22 13:23:50.210766"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 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 Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (5.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (2.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.232722"], ["updated_at", "2020-12-22 13:23:50.232722"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:50.241630"], ["updated_at", "2020-12-22 13:23:50.241630"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.246632"], ["updated_at", "2020-12-22 13:23:50.246632"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.253226"], ["updated_at", "2020-12-22 13:23:50.253226"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:23:50.257377"], ["updated_at", "2020-12-22 13:23:50.257377"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 964], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 964], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:50.262209"], ["id", 964]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 964], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:23:50.270441"], ["updated_at", "2020-12-22 13:23:50.270441"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729830"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.275773"], ["updated_at", "2020-12-22 13:23:50.275773"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:23:50.281203"], ["updated_at", "2020-12-22 13:23:50.281203"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557030"], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.287211"], ["updated_at", "2020-12-22 13:23:50.287211"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 966], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:23:50.309786"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 966]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (3.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:50.315449"], ["updated_at", "2020-12-22 13:23:50.315449"], ["synced_id", 123], ["host", "test.example"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.327796"], ["updated_at", "2020-12-22 13:23:50.327796"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:23:50.360783"], ["updated_at", "2020-12-22 13:23:50.360783"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:50.368072"], ["updated_at", "2020-12-22 13:23:50.368072"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.373376"], ["updated_at", "2020-12-22 13:23:50.373376"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:50.380979"], ["updated_at", "2020-12-22 13:23:50.380979"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:50.385768"], ["updated_at", "2020-12-22 13:23:50.385768"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:50.388336"], ["updated_at", "2020-12-22 13:23:50.388336"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:50.390708"], ["updated_at", "2020-12-22 13:23:50.390708"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.396483"], ["updated_at", "2020-12-22 13:23:50.396483"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.401438"], ["updated_at", "2020-12-22 13:23:50.401438"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.405825"], ["updated_at", "2020-12-22 13:23:50.405825"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.408647"], ["updated_at", "2020-12-22 13:23:50.408647"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:23:50.414275"], ["updated_at", "2020-12-22 13:23:50.414275"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:23:50.422444"], ["updated_at", "2020-12-22 13:23:50.422444"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.424958"], ["updated_at", "2020-12-22 13:23:50.424958"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:23:50.434763"], ["updated_at", "2020-12-22 13:23:50.434763"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:23:50.437418"], ["updated_at", "2020-12-22 13:23:50.437418"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:23:50.442754"], ["updated_at", "2020-12-22 13:23:50.442754"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.446846"], ["updated_at", "2020-12-22 13:23:50.446846"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.453781"], ["updated_at", "2020-12-22 13:23:50.453781"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.456424"], ["updated_at", "2020-12-22 13:23:50.456424"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) 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", 985], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:50.460960"], ["id", 985]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.468975"], ["updated_at", "2020-12-22 13:23:50.468975"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.474712"], ["updated_at", "2020-12-22 13:23:50.474712"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 987], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:23:50.479476"], ["id", 987]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 987], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.485062"], ["updated_at", "2020-12-22 13:23:50.485062"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.488041"], ["updated_at", "2020-12-22 13:23:50.488041"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 989], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 13:23:50.493944"], ["id", 989]]  (2.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 989], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (1.9ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:23:50.519742"], ["updated_at", "2020-12-22 13:23:50.519742"], ["synced_id", 123]]  (0.1ms) 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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (2.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:50.534868"], ["updated_at", "2020-12-22 13:23:50.534868"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:23:50.539123"], ["updated_at", "2020-12-22 13:23:50.539123"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.550752"], ["updated_at", "2020-12-22 13:23:50.550752"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.558213"], ["updated_at", "2020-12-22 13:23:50.558213"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) 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]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.579763"], ["updated_at", "2020-12-22 13:23:50.579763"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.596960"], ["updated_at", "2020-12-22 13:23:50.596960"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.608734"], ["updated_at", "2020-12-22 13:23:50.608734"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.619773"], ["updated_at", "2020-12-22 13:23:50.619773"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:23:50.637980"], ["updated_at", "2020-12-22 13:23:50.637980"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 11ms (Views: 10.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 45ms (Views: 38.0ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (2.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (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", "2020-12-22 13:24:20.815314"], ["updated_at", "2020-12-22 13:24:20.815314"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:20.839252"], ["updated_at", "2020-12-22 13:24:20.839252"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:20.842234"], ["updated_at", "2020-12-22 13:24:20.842234"], ["synced_id", 2]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:20.846237"], ["updated_at", "2020-12-22 13:24:20.846237"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:20.864856"], ["updated_at", "2020-12-22 13:24:20.864856"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:20.938410"], ["updated_at", "2020-12-22 13:24:20.938410"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:20.985983"], ["updated_at", "2020-12-22 13:24:20.985983"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (31.9ms) ROLLBACK  (3.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:21.137343"], ["updated_at", "2020-12-22 13:24:21.137343"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.141642"], ["updated_at", "2020-12-22 13:24:21.141642"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557061"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1048], ["LIMIT", 1]] SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:24:21.161114"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1048]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:24:21.166602"], ["updated_at", "2020-12-22 13:24:21.166602"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729861"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.171420"], ["updated_at", "2020-12-22 13:24:21.171420"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1050], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1050], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.175854"], ["id", 1050]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1050], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:24:21.188967"], ["updated_at", "2020-12-22 13:24:21.188967"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:24:21.190504"], ["synced_id", 0], ["id", 1051]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.205459"], ["updated_at", "2020-12-22 13:24:21.205459"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.209647"], ["updated_at", "2020-12-22 13:24:21.209647"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.214015"], ["updated_at", "2020-12-22 13:24:21.214015"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:24:21.217124"], ["updated_at", "2020-12-22 13:24:21.217124"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.221179"], ["updated_at", "2020-12-22 13:24:21.221179"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.223848"], ["updated_at", "2020-12-22 13:24:21.223848"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.229212"], ["updated_at", "2020-12-22 13:24:21.229212"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.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.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.237718"], ["updated_at", "2020-12-22 13:24:21.237718"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.246834"], ["updated_at", "2020-12-22 13:24:21.246834"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.249210"], ["updated_at", "2020-12-22 13:24:21.249210"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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", 1061], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.252748"], ["id", 1061]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.256402"], ["updated_at", "2020-12-22 13:24:21.256402"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.258479"], ["updated_at", "2020-12-22 13:24:21.258479"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1063], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.261045"], ["id", 1063]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.264865"], ["updated_at", "2020-12-22 13:24:21.264865"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.266884"], ["updated_at", "2020-12-22 13:24:21.266884"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1065], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.270373"], ["id", 1065]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1065], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.275743"], ["updated_at", "2020-12-22 13:24:21.275743"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.277965"], ["updated_at", "2020-12-22 13:24:21.277965"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1067], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.281345"], ["id", 1067]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1067], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (3.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.334589"], ["updated_at", "2020-12-22 13:24:21.334589"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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]] SQL (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", "2020-12-22 13:24:21.355192"], ["updated_at", "2020-12-22 13:24:21.355192"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:24:21.365243"], ["updated_at", "2020-12-22 13:24:21.365243"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557061"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.369557"], ["updated_at", "2020-12-22 13:24:21.369557"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 994], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:24:21.387670"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 994]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:24:21.391856"], ["updated_at", "2020-12-22 13:24:21.391856"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729861"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.395315"], ["updated_at", "2020-12-22 13:24:21.395315"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:24:21.399543"], ["updated_at", "2020-12-22 13:24:21.399543"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.404243"], ["updated_at", "2020-12-22 13:24:21.404243"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.407182"], ["updated_at", "2020-12-22 13:24:21.407182"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.409931"], ["updated_at", "2020-12-22 13:24:21.409931"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:24:21.415506"], ["updated_at", "2020-12-22 13:24:21.415506"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 998], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 998], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.422990"], ["id", 998]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 998], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.432480"], ["updated_at", "2020-12-22 13:24:21.432480"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.436075"], ["updated_at", "2020-12-22 13:24:21.436075"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.439646"], ["updated_at", "2020-12-22 13:24:21.439646"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.441533"], ["updated_at", "2020-12-22 13:24:21.441533"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.445723"], ["updated_at", "2020-12-22 13:24:21.445723"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (2.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.448955"], ["updated_at", "2020-12-22 13:24:21.448955"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.469409"], ["updated_at", "2020-12-22 13:24:21.469409"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.471491"], ["updated_at", "2020-12-22 13:24:21.471491"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1004], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.474735"], ["id", 1004]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.478460"], ["updated_at", "2020-12-22 13:24:21.478460"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.480544"], ["updated_at", "2020-12-22 13:24:21.480544"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1006], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.483580"], ["id", 1006]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1006], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.488047"], ["updated_at", "2020-12-22 13:24:21.488047"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.490134"], ["updated_at", "2020-12-22 13:24:21.490134"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1008], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.493199"], ["id", 1008]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1008], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.497739"], ["updated_at", "2020-12-22 13:24:21.497739"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.499747"], ["updated_at", "2020-12-22 13:24:21.499747"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:24:21.503923"], ["updated_at", "2020-12-22 13:24:21.503923"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:24:21.508606"], ["updated_at", "2020-12-22 13:24:21.508606"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.510826"], ["updated_at", "2020-12-22 13:24:21.510826"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:24:21.515376"], ["updated_at", "2020-12-22 13:24:21.515376"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.520177"], ["updated_at", "2020-12-22 13:24:21.520177"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:24:21.526188"], ["updated_at", "2020-12-22 13:24:21.526188"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.529193"], ["updated_at", "2020-12-22 13:24:21.529193"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.533419"], ["updated_at", "2020-12-22 13:24:21.533419"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.536336"], ["updated_at", "2020-12-22 13:24:21.536336"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.539802"], ["updated_at", "2020-12-22 13:24:21.539802"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) 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]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.545516"], ["updated_at", "2020-12-22 13:24:21.545516"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.558006"], ["updated_at", "2020-12-22 13:24:21.558006"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.575016"], ["updated_at", "2020-12-22 13:24:21.575016"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.582752"], ["updated_at", "2020-12-22 13:24:21.582752"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.591204"], ["updated_at", "2020-12-22 13:24:21.591204"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.604167"], ["updated_at", "2020-12-22 13:24:21.604167"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.614195"], ["updated_at", "2020-12-22 13:24:21.614195"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:21.628131"], ["updated_at", "2020-12-22 13:24:21.628131"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.635685"], ["updated_at", "2020-12-22 13:24:21.635685"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.644732"], ["updated_at", "2020-12-22 13:24:21.644732"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:24:21.651327"], ["updated_at", "2020-12-22 13:24:21.651327"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:24:21.659673"], ["updated_at", "2020-12-22 13:24:21.659673"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.688309"], ["updated_at", "2020-12-22 13:24:21.688309"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:21.690962"], ["updated_at", "2020-12-22 13:24:21.690962"], ["synced_id", 123], ["host", "test.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:21.697054"], ["updated_at", "2020-12-22 13:24:21.697054"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 Application Exists (3.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.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", "2020-12-22 13:24:34.628106"], ["updated_at", "2020-12-22 13:24:34.628106"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (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", "2020-12-22 13:24:34.671681"], ["updated_at", "2020-12-22 13:24:34.671681"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.681285"], ["updated_at", "2020-12-22 13:24:34.681285"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:34.684779"], ["updated_at", "2020-12-22 13:24:34.684779"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.688188"], ["updated_at", "2020-12-22 13:24:34.688188"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:34.691273"], ["updated_at", "2020-12-22 13:24:34.691273"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.694460"], ["updated_at", "2020-12-22 13:24:34.694460"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:34.696850"], ["updated_at", "2020-12-22 13:24:34.696850"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.701669"], ["updated_at", "2020-12-22 13:24:34.701669"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:34.703990"], ["updated_at", "2020-12-22 13:24:34.703990"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.707891"], ["updated_at", "2020-12-22 13:24:34.707891"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.709657"], ["updated_at", "2020-12-22 13:24:34.709657"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1082], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:24:34.712172"], ["id", 1082]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.715774"], ["updated_at", "2020-12-22 13:24:34.715774"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.717613"], ["updated_at", "2020-12-22 13:24:34.717613"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1084], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:24:34.720095"], ["id", 1084]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1084], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.724522"], ["updated_at", "2020-12-22 13:24:34.724522"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.726510"], ["updated_at", "2020-12-22 13:24:34.726510"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1086], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:24:34.728995"], ["id", 1086]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1086], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.733080"], ["updated_at", "2020-12-22 13:24:34.733080"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.735000"], ["updated_at", "2020-12-22 13:24:34.735000"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1088], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:24:34.738018"], ["id", 1088]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:24:34.746732"], ["updated_at", "2020-12-22 13:24:34.746732"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:24:34.748449"], ["synced_id", 0], ["id", 1089]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:34.763339"], ["updated_at", "2020-12-22 13:24:34.763339"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:34.770978"], ["updated_at", "2020-12-22 13:24:34.770978"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1091], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1091], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:24:34.775164"], ["id", 1091]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1091], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:34.779465"], ["updated_at", "2020-12-22 13:24:34.779465"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:34.810430"], ["updated_at", "2020-12-22 13:24:34.810430"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:34.853736"], ["updated_at", "2020-12-22 13:24:34.853736"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:34.857577"], ["updated_at", "2020-12-22 13:24:34.857577"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557074"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1095], ["LIMIT", 1]] Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:24:34.873995"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1095]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:34.877484"], ["updated_at", "2020-12-22 13:24:34.877484"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729874"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:34.880797"], ["updated_at", "2020-12-22 13:24:34.880797"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:34.882590"], ["updated_at", "2020-12-22 13:24:34.882590"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:34.884468"], ["updated_at", "2020-12-22 13:24:34.884468"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 8.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:34.910531"], ["updated_at", "2020-12-22 13:24:34.910531"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:34.915708"], ["updated_at", "2020-12-22 13:24:34.915708"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) 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.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:34.925031"], ["updated_at", "2020-12-22 13:24:34.925031"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (2.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "2020-12-22 13:24:34.946913"], ["updated_at", "2020-12-22 13:24:34.946913"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 15ms (ActiveRecord: 3.2ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "test.example"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.961634"], ["updated_at", "2020-12-22 13:24:34.961634"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:34.965014"], ["updated_at", "2020-12-22 13:24:34.965014"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:34.968029"], ["updated_at", "2020-12-22 13:24:34.968029"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.4ms) 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", "2020-12-22 13:24:34.973760"], ["updated_at", "2020-12-22 13:24:34.973760"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:24:34.979294"], ["updated_at", "2020-12-22 13:24:34.979294"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1027], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1027], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:24:34.982504"], ["id", 1027]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1027], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:34.986379"], ["updated_at", "2020-12-22 13:24:34.986379"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.995977"], ["updated_at", "2020-12-22 13:24:34.995977"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.997883"], ["updated_at", "2020-12-22 13:24:34.997883"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:34.999883"], ["updated_at", "2020-12-22 13:24:34.999883"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:35.001631"], ["updated_at", "2020-12-22 13:24:35.001631"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.005701"], ["updated_at", "2020-12-22 13:24:35.005701"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.008138"], ["updated_at", "2020-12-22 13:24:35.008138"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.014019"], ["updated_at", "2020-12-22 13:24:35.014019"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.016015"], ["updated_at", "2020-12-22 13:24:35.016015"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1035], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:24:35.018695"], ["id", 1035]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.022474"], ["updated_at", "2020-12-22 13:24:35.022474"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.026739"], ["updated_at", "2020-12-22 13:24:35.026739"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1037], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:24:35.029728"], ["id", 1037]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1037], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.033697"], ["updated_at", "2020-12-22 13:24:35.033697"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.035744"], ["updated_at", "2020-12-22 13:24:35.035744"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1039], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:24:35.038356"], ["id", 1039]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1039], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.042884"], ["updated_at", "2020-12-22 13:24:35.042884"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.044993"], ["updated_at", "2020-12-22 13:24:35.044993"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:24:35.048089"], ["updated_at", "2020-12-22 13:24:35.048089"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:24:35.052725"], ["updated_at", "2020-12-22 13:24:35.052725"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.054643"], ["updated_at", "2020-12-22 13:24:35.054643"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:24:35.059152"], ["updated_at", "2020-12-22 13:24:35.059152"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.061060"], ["updated_at", "2020-12-22 13:24:35.061060"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:24:35.064817"], ["updated_at", "2020-12-22 13:24:35.064817"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.066808"], ["updated_at", "2020-12-22 13:24:35.066808"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:24:35.070106"], ["updated_at", "2020-12-22 13:24:35.070106"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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", "2020-12-22 13:24:35.074679"], ["updated_at", "2020-12-22 13:24:35.074679"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729875"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.077961"], ["updated_at", "2020-12-22 13:24:35.077961"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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", "2020-12-22 13:24:35.082213"], ["updated_at", "2020-12-22 13:24:35.082213"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557075"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.085118"], ["updated_at", "2020-12-22 13:24:35.085118"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1052], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:24:35.102107"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1052]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:35.105392"], ["updated_at", "2020-12-22 13:24:35.105392"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.109059"], ["updated_at", "2020-12-22 13:24:35.109059"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:35.126468"], ["updated_at", "2020-12-22 13:24:35.126468"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.129435"], ["updated_at", "2020-12-22 13:24:35.129435"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:35.136056"], ["updated_at", "2020-12-22 13:24:35.136056"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:35.138170"], ["updated_at", "2020-12-22 13:24:35.138170"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:35.143288"], ["updated_at", "2020-12-22 13:24:35.143288"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.159020"], ["updated_at", "2020-12-22 13:24:35.159020"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.170914"], ["updated_at", "2020-12-22 13:24:35.170914"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.180762"], ["updated_at", "2020-12-22 13:24:35.180762"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.188128"], ["updated_at", "2020-12-22 13:24:35.188128"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.202974"], ["updated_at", "2020-12-22 13:24:35.202974"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:35.238898"], ["updated_at", "2020-12-22 13:24:35.238898"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.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", "2020-12-22 13:24:47.848472"], ["updated_at", "2020-12-22 13:24:47.848472"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.872285"], ["updated_at", "2020-12-22 13:24:47.872285"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.880434"], ["updated_at", "2020-12-22 13:24:47.880434"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.894168"], ["updated_at", "2020-12-22 13:24:47.894168"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) 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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.906848"], ["updated_at", "2020-12-22 13:24:47.906848"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.915422"], ["updated_at", "2020-12-22 13:24:47.915422"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.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", "2020-12-22 13:24:47.945606"], ["updated_at", "2020-12-22 13:24:47.945606"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.948578"], ["updated_at", "2020-12-22 13:24:47.948578"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1057], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:24:47.951778"], ["id", 1057]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.957742"], ["updated_at", "2020-12-22 13:24:47.957742"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.959913"], ["updated_at", "2020-12-22 13:24:47.959913"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1059], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:24:47.962594"], ["id", 1059]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1059], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.966937"], ["updated_at", "2020-12-22 13:24:47.966937"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.969151"], ["updated_at", "2020-12-22 13:24:47.969151"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1061], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:24:47.972610"], ["id", 1061]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1061], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.976947"], ["updated_at", "2020-12-22 13:24:47.976947"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.978920"], ["updated_at", "2020-12-22 13:24:47.978920"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:24:47.986048"], ["updated_at", "2020-12-22 13:24:47.986048"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:24:47.991791"], ["updated_at", "2020-12-22 13:24:47.991791"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.993827"], ["updated_at", "2020-12-22 13:24:47.993827"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:24:47.997846"], ["updated_at", "2020-12-22 13:24:47.997846"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:47.999935"], ["updated_at", "2020-12-22 13:24:47.999935"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:24:48.004788"], ["updated_at", "2020-12-22 13:24:48.004788"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.006794"], ["updated_at", "2020-12-22 13:24:48.006794"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.010207"], ["updated_at", "2020-12-22 13:24:48.010207"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.012708"], ["updated_at", "2020-12-22 13:24:48.012708"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.020172"], ["updated_at", "2020-12-22 13:24:48.020172"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.051562"], ["updated_at", "2020-12-22 13:24:48.051562"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.056176"], ["updated_at", "2020-12-22 13:24:48.056176"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.059442"], ["updated_at", "2020-12-22 13:24:48.059442"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:24:48.063424"], ["updated_at", "2020-12-22 13:24:48.063424"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.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", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.070881"], ["updated_at", "2020-12-22 13:24:48.070881"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.072916"], ["updated_at", "2020-12-22 13:24:48.072916"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.074875"], ["updated_at", "2020-12-22 13:24:48.074875"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.076929"], ["updated_at", "2020-12-22 13:24:48.076929"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.080949"], ["updated_at", "2020-12-22 13:24:48.080949"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists? (0.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.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists? (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.090879"], ["updated_at", "2020-12-22 13:24:48.090879"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.094450"], ["updated_at", "2020-12-22 13:24:48.094450"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 13:24:48.123266"], ["updated_at", "2020-12-22 13:24:48.123266"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729888"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.126354"], ["updated_at", "2020-12-22 13:24:48.126354"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:24:48.130345"], ["updated_at", "2020-12-22 13:24:48.130345"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557088"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.133423"], ["updated_at", "2020-12-22 13:24:48.133423"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1083], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:24:48.150060"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1083]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:24:48.171536"], ["updated_at", "2020-12-22 13:24:48.171536"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1084], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1084], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:24:48.174791"], ["id", 1084]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1084], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.178873"], ["updated_at", "2020-12-22 13:24:48.178873"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.181574"], ["updated_at", "2020-12-22 13:24:48.181574"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 2.6ms | Allocations: 264) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 23ms (Views: 11.2ms | ActiveRecord: 0.0ms | Allocations: 3646)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 0.1ms | Allocations: 54) 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 | Allocations: 426)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 163)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 118)  (0.2ms) ROLLBACK  (0.1ms) 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]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.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", "2020-12-22 13:24:48.259497"], ["updated_at", "2020-12-22 13:24:48.259497"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 16ms (ActiveRecord: 5.8ms | Allocations: 6349)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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.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", "2020-12-22 13:24:48.266441"], ["updated_at", "2020-12-22 13:24:48.266441"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.5ms | Allocations: 877)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:48.276923"], ["updated_at", "2020-12-22 13:24:48.276923"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms | Allocations: 882)  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 13:24:48.287306"], ["updated_at", "2020-12-22 13:24:48.287306"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms | Allocations: 966)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:48.293709"], ["updated_at", "2020-12-22 13:24:48.293709"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:48.295701"], ["updated_at", "2020-12-22 13:24:48.295701"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:48.297488"], ["updated_at", "2020-12-22 13:24:48.297488"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:48.301421"], ["updated_at", "2020-12-22 13:24:48.301421"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1110], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1110], ["LIMIT", 1]] Account Update (0.2ms) 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", "2020-12-22 13:24:48.305036"], ["id", 1110]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1110], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:48.308674"], ["updated_at", "2020-12-22 13:24:48.308674"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.311875"], ["updated_at", "2020-12-22 13:24:48.311875"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.313610"], ["updated_at", "2020-12-22 13:24:48.313610"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1113], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:24:48.316121"], ["id", 1113]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1113], ["LIMIT", 1]]  (4.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.324229"], ["updated_at", "2020-12-22 13:24:48.324229"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.326165"], ["updated_at", "2020-12-22 13:24:48.326165"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1115], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:24:48.328888"], ["id", 1115]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1115], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.332884"], ["updated_at", "2020-12-22 13:24:48.332884"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.334579"], ["updated_at", "2020-12-22 13:24:48.334579"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1117], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:24:48.338347"], ["id", 1117]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.341492"], ["updated_at", "2020-12-22 13:24:48.341492"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.343233"], ["updated_at", "2020-12-22 13:24:48.343233"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1119], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:24:48.345948"], ["id", 1119]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.349023"], ["updated_at", "2020-12-22 13:24:48.349023"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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", "2020-12-22 13:24:48.352021"], ["updated_at", "2020-12-22 13:24:48.352021"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.356295"], ["updated_at", "2020-12-22 13:24:48.356295"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:48.358733"], ["updated_at", "2020-12-22 13:24:48.358733"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.361977"], ["updated_at", "2020-12-22 13:24:48.361977"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:48.364374"], ["updated_at", "2020-12-22 13:24:48.364374"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.367144"], ["updated_at", "2020-12-22 13:24:48.367144"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 13:24:48.369767"], ["updated_at", "2020-12-22 13:24:48.369767"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:48.373427"], ["updated_at", "2020-12-22 13:24:48.373427"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:48.376717"], ["updated_at", "2020-12-22 13:24:48.376717"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:48.394616"], ["updated_at", "2020-12-22 13:24:48.394616"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:24:48.414218"], ["updated_at", "2020-12-22 13:24:48.414218"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:24:48.415521"], ["synced_id", 0], ["id", 1131]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists? (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:48.422252"], ["updated_at", "2020-12-22 13:24:48.422252"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:48.425563"], ["updated_at", "2020-12-22 13:24:48.425563"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608729888"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:24:48.429305"], ["updated_at", "2020-12-22 13:24:48.429305"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557088"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1134], ["LIMIT", 1]] Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:24:48.445255"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1134]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:24:48.455599"], ["updated_at", "2020-12-22 13:24:48.455599"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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 | Allocations: 149)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (Duration: 0.0ms | Allocations: 3) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms | Allocations: 517)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms | Allocations: 350)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 165)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.486336"], ["updated_at", "2020-12-22 13:24:48.486336"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:24:48.488997"], ["updated_at", "2020-12-22 13:24:48.488997"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:24:48.494892"], ["updated_at", "2020-12-22 13:24:48.494892"], ["synced_id", 123]]  (0.1ms) 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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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]]  (0.2ms) 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]] SQL (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", "2020-12-22 13:29:54.147480"], ["updated_at", "2020-12-22 13:29:54.147480"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 96ms (ActiveRecord: 26.3ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:29:54.173988"], ["updated_at", "2020-12-22 13:29:54.173988"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.4ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.193151"], ["updated_at", "2020-12-22 13:29:54.193151"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (2.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) 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]] SQL (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", "2020-12-22 13:29:54.234516"], ["updated_at", "2020-12-22 13:29:54.234516"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 26ms (ActiveRecord: 3.3ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 20ms (Views: 17.8ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.9ms | ActiveRecord: 0.0ms)  (1.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.294048"], ["updated_at", "2020-12-22 13:29:54.294048"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.324868"], ["updated_at", "2020-12-22 13:29:54.324868"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.333182"], ["updated_at", "2020-12-22 13:29:54.333182"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.335460"], ["updated_at", "2020-12-22 13:29:54.335460"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1091], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.338331"], ["id", 1091]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.343258"], ["updated_at", "2020-12-22 13:29:54.343258"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.345218"], ["updated_at", "2020-12-22 13:29:54.345218"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.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"."id" != $2) AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1093], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.349549"], ["id", 1093]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1093], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:29:54.355540"], ["updated_at", "2020-12-22 13:29:54.355540"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.360874"], ["updated_at", "2020-12-22 13:29:54.360874"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1095], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.365043"], ["id", 1095]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1095], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.369707"], ["updated_at", "2020-12-22 13:29:54.369707"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.373049"], ["updated_at", "2020-12-22 13:29:54.373049"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:29:54.376897"], ["updated_at", "2020-12-22 13:29:54.376897"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:29:54.381957"], ["updated_at", "2020-12-22 13:29:54.381957"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.384382"], ["updated_at", "2020-12-22 13:29:54.384382"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) 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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:29:54.391560"], ["updated_at", "2020-12-22 13:29:54.391560"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.394576"], ["updated_at", "2020-12-22 13:29:54.394576"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (6.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", "2020-12-22 13:29:54.401632"], ["updated_at", "2020-12-22 13:29:54.401632"], ["provider", "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.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.412954"], ["updated_at", "2020-12-22 13:29:54.412954"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.6ms) BEGIN  (0.2ms) 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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.418404"], ["updated_at", "2020-12-22 13:29:54.418404"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:29:54.421468"], ["updated_at", "2020-12-22 13:29:54.421468"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.430192"], ["updated_at", "2020-12-22 13:29:54.430192"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.465771"], ["updated_at", "2020-12-22 13:29:54.465771"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] SQL (6.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.487206"], ["updated_at", "2020-12-22 13:29:54.487206"], ["synced_id", 123], ["host", "test.example"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.501483"], ["updated_at", "2020-12-22 13:29:54.501483"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:29:54.542014"], ["updated_at", "2020-12-22 13:29:54.542014"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.550052"], ["updated_at", "2020-12-22 13:29:54.550052"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.552696"], ["updated_at", "2020-12-22 13:29:54.552696"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.554663"], ["updated_at", "2020-12-22 13:29:54.554663"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.557514"], ["updated_at", "2020-12-22 13:29:54.557514"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:29:54.563810"], ["updated_at", "2020-12-22 13:29:54.563810"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730194"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.568379"], ["updated_at", "2020-12-22 13:29:54.568379"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:29:54.572749"], ["updated_at", "2020-12-22 13:29:54.572749"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557394"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.577199"], ["updated_at", "2020-12-22 13:29:54.577199"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1116], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:29:54.595761"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1116]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.600436"], ["updated_at", "2020-12-22 13:29:54.600436"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.604080"], ["updated_at", "2020-12-22 13:29:54.604080"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.608850"], ["updated_at", "2020-12-22 13:29:54.608850"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:29:54.613240"], ["updated_at", "2020-12-22 13:29:54.613240"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1118], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1118], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.617663"], ["id", 1118]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1118], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.625273"], ["updated_at", "2020-12-22 13:29:54.625273"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.634831"], ["updated_at", "2020-12-22 13:29:54.634831"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.644191"], ["updated_at", "2020-12-22 13:29:54.644191"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.659015"], ["updated_at", "2020-12-22 13:29:54.659015"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.674171"], ["updated_at", "2020-12-22 13:29:54.674171"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.687538"], ["updated_at", "2020-12-22 13:29:54.687538"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:29:54.700251"], ["updated_at", "2020-12-22 13:29:54.700251"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.709973"], ["updated_at", "2020-12-22 13:29:54.709973"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.712499"], ["updated_at", "2020-12-22 13:29:54.712499"], ["synced_id", 123], ["host", "test.host"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:29:54.730569"], ["updated_at", "2020-12-22 13:29:54.730569"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.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.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.761506"], ["updated_at", "2020-12-22 13:29:54.761506"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.764187"], ["updated_at", "2020-12-22 13:29:54.764187"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1141], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.767498"], ["id", 1141]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1141], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.774294"], ["updated_at", "2020-12-22 13:29:54.774294"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.776273"], ["updated_at", "2020-12-22 13:29:54.776273"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1143], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.779755"], ["id", 1143]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1143], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.784985"], ["updated_at", "2020-12-22 13:29:54.784985"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.787736"], ["updated_at", "2020-12-22 13:29:54.787736"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1145], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.791878"], ["id", 1145]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.796604"], ["updated_at", "2020-12-22 13:29:54.796604"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.799063"], ["updated_at", "2020-12-22 13:29:54.799063"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1147], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.802625"], ["id", 1147]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.807314"], ["updated_at", "2020-12-22 13:29:54.807314"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.811548"], ["updated_at", "2020-12-22 13:29:54.811548"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.816841"], ["updated_at", "2020-12-22 13:29:54.816841"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.820531"], ["updated_at", "2020-12-22 13:29:54.820531"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.825004"], ["updated_at", "2020-12-22 13:29:54.825004"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.828215"], ["updated_at", "2020-12-22 13:29:54.828215"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:29:54.831761"], ["updated_at", "2020-12-22 13:29:54.831761"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.834553"], ["updated_at", "2020-12-22 13:29:54.834553"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:29:54.838028"], ["updated_at", "2020-12-22 13:29:54.838028"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:29:54.841576"], ["updated_at", "2020-12-22 13:29:54.841576"], ["synced_id", 1]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:29:54.844709"], ["updated_at", "2020-12-22 13:29:54.844709"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:29:54.846637"], ["updated_at", "2020-12-22 13:29:54.846637"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.851423"], ["updated_at", "2020-12-22 13:29:54.851423"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730194"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.854930"], ["updated_at", "2020-12-22 13:29:54.854930"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557394"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1161], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:29:54.873521"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1161]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:29:54.877239"], ["updated_at", "2020-12-22 13:29:54.877239"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:29:54.898373"], ["updated_at", "2020-12-22 13:29:54.898373"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.927155"], ["updated_at", "2020-12-22 13:29:54.927155"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1164], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1164], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.931732"], ["id", 1164]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1164], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:29:54.936845"], ["updated_at", "2020-12-22 13:29:54.936845"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:29:54.941711"], ["updated_at", "2020-12-22 13:29:54.941711"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:29:54.954007"], ["updated_at", "2020-12-22 13:29:54.954007"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:29:54.955707"], ["synced_id", 0], ["id", 1167]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) 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]]  (0.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]] SQL (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", "2020-12-22 13:30:08.204603"], ["updated_at", "2020-12-22 13:30:08.204603"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 77ms (ActiveRecord: 9.7ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN 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]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.227809"], ["updated_at", "2020-12-22 13:30:08.227809"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 3.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (4.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:30:08.291164"], ["updated_at", "2020-12-22 13:30:08.291164"], ["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.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 40ms (ActiveRecord: 3.6ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.4ms) 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.8ms) ROLLBACK  (0.1ms) BEGIN  (1.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.323303"], ["updated_at", "2020-12-22 13:30:08.323303"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 11ms (ActiveRecord: 1.3ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.4ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 16ms (Views: 12.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (1.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.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:08.388672"], ["updated_at", "2020-12-22 13:30:08.388672"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:08.426965"], ["updated_at", "2020-12-22 13:30:08.426965"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.450109"], ["updated_at", "2020-12-22 13:30:08.450109"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557408"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1173], ["LIMIT", 1]] SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:30:08.469312"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1173]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.476144"], ["updated_at", "2020-12-22 13:30:08.476144"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730208"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:08.480256"], ["updated_at", "2020-12-22 13:30:08.480256"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:08.485803"], ["updated_at", "2020-12-22 13:30:08.485803"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:08.489942"], ["updated_at", "2020-12-22 13:30:08.489942"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:08.493897"], ["updated_at", "2020-12-22 13:30:08.493897"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) 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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.505724"], ["updated_at", "2020-12-22 13:30:08.505724"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "accounts" Account Load (0.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.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.515240"], ["updated_at", "2020-12-22 13:30:08.515240"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.522446"], ["updated_at", "2020-12-22 13:30:08.522446"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) 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.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.527474"], ["updated_at", "2020-12-22 13:30:08.527474"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.531810"], ["updated_at", "2020-12-22 13:30:08.531810"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (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", "2020-12-22 13:30:08.536564"], ["updated_at", "2020-12-22 13:30:08.536564"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.544121"], ["updated_at", "2020-12-22 13:30:08.544121"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.548234"], ["updated_at", "2020-12-22 13:30:08.548234"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.552936"], ["updated_at", "2020-12-22 13:30:08.552936"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.555970"], ["updated_at", "2020-12-22 13:30:08.555970"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1188], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.559580"], ["id", 1188]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1188], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (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", 456], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.569263"], ["updated_at", "2020-12-22 13:30:08.569263"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.574577"], ["updated_at", "2020-12-22 13:30:08.574577"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) 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.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1190], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.580581"], ["id", 1190]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1190], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.588155"], ["updated_at", "2020-12-22 13:30:08.588155"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.592534"], ["updated_at", "2020-12-22 13:30:08.592534"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1192], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.597357"], ["id", 1192]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.604005"], ["updated_at", "2020-12-22 13:30:08.604005"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.606615"], ["updated_at", "2020-12-22 13:30:08.606615"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1194], ["LIMIT", 1]] SQL (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", "2020-12-22 13:30:08.613551"], ["id", 1194]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.620842"], ["updated_at", "2020-12-22 13:30:08.620842"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1195], ["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", 1195], ["LIMIT", 1]] SQL (5.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", "2020-12-22 13:30:08.632771"], ["id", 1195]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1195], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.646559"], ["updated_at", "2020-12-22 13:30:08.646559"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (3.1ms) ROLLBACK  (7.0ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (12.3ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:30:08.731774"], ["updated_at", "2020-12-22 13:30:08.731774"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:30:08.736418"], ["synced_id", 0], ["id", 1197]]  (0.2ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:08.761291"], ["updated_at", "2020-12-22 13:30:08.761291"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (2.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.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.5ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.9ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (4.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.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]] SQL (2.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:08.818520"], ["updated_at", "2020-12-22 13:30:08.818520"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:08.830417"], ["updated_at", "2020-12-22 13:30:08.830417"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:08.837532"], ["updated_at", "2020-12-22 13:30:08.837532"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (1.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:08.868569"], ["updated_at", "2020-12-22 13:30:08.868569"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 13:30:08.873075"], ["updated_at", "2020-12-22 13:30:08.873075"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:08.879376"], ["updated_at", "2020-12-22 13:30:08.879376"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:30:08.882798"], ["updated_at", "2020-12-22 13:30:08.882798"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) 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.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", 1125], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.892224"], ["id", 1125]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:08.898345"], ["updated_at", "2020-12-22 13:30:08.898345"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:30:08.902531"], ["updated_at", "2020-12-22 13:30:08.902531"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.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", 1127], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.909223"], ["id", 1127]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1127], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:30:08.915616"], ["updated_at", "2020-12-22 13:30:08.915616"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) 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]] SQL (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", "2020-12-22 13:30:08.923363"], ["updated_at", "2020-12-22 13:30:08.923363"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1129], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.931193"], ["id", 1129]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (2.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1129], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.8ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 13:30:08.942476"], ["updated_at", "2020-12-22 13:30:08.942476"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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", 456], ["host", "example2.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 13:30:08.952475"], ["updated_at", "2020-12-22 13:30:08.952475"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:30:08.960201"], ["updated_at", "2020-12-22 13:30:08.960201"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.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", "example3.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:08.967888"], ["updated_at", "2020-12-22 13:30:08.967888"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:08.970797"], ["updated_at", "2020-12-22 13:30:08.970797"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:30:08.978159"], ["updated_at", "2020-12-22 13:30:08.978159"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:08.980558"], ["updated_at", "2020-12-22 13:30:08.980558"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:30:08.986685"], ["updated_at", "2020-12-22 13:30:08.986685"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:08.989535"], ["updated_at", "2020-12-22 13:30:08.989535"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:08.994297"], ["updated_at", "2020-12-22 13:30:08.994297"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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 (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:30:09.006418"], ["updated_at", "2020-12-22 13:30:09.006418"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1141], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1141], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:30:09.011706"], ["id", 1141]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1141], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:09.016825"], ["updated_at", "2020-12-22 13:30:09.016825"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.020371"], ["updated_at", "2020-12-22 13:30:09.020371"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:30:09.027904"], ["updated_at", "2020-12-22 13:30:09.027904"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557409"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.032476"], ["updated_at", "2020-12-22 13:30:09.032476"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) 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]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:30:09.057391"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1143]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:30:09.063188"], ["updated_at", "2020-12-22 13:30:09.063188"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730209"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.067849"], ["updated_at", "2020-12-22 13:30:09.067849"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.075730"], ["updated_at", "2020-12-22 13:30:09.075730"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:30:09.080720"], ["updated_at", "2020-12-22 13:30:09.080720"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "example.test"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:09.086574"], ["updated_at", "2020-12-22 13:30:09.086574"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:09.089006"], ["updated_at", "2020-12-22 13:30:09.089006"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:09.092492"], ["updated_at", "2020-12-22 13:30:09.092492"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:09.094646"], ["updated_at", "2020-12-22 13:30:09.094646"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:09.100085"], ["updated_at", "2020-12-22 13:30:09.100085"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.103646"], ["updated_at", "2020-12-22 13:30:09.103646"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.107923"], ["updated_at", "2020-12-22 13:30:09.107923"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.115110"], ["updated_at", "2020-12-22 13:30:09.115110"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.125263"], ["updated_at", "2020-12-22 13:30:09.125263"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.143312"], ["updated_at", "2020-12-22 13:30:09.143312"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.161501"], ["updated_at", "2020-12-22 13:30:09.161501"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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 (3.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.182647"], ["updated_at", "2020-12-22 13:30:09.182647"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:09.195101"], ["updated_at", "2020-12-22 13:30:09.195101"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:09.214963"], ["updated_at", "2020-12-22 13:30:09.214963"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:09.220746"], ["updated_at", "2020-12-22 13:30:09.220746"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:09.223427"], ["updated_at", "2020-12-22 13:30:09.223427"], ["synced_id", 123], ["host", "test.host"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:23.951420"], ["updated_at", "2020-12-22 13:30:23.951420"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.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", "2020-12-22 13:30:23.979284"], ["updated_at", "2020-12-22 13:30:23.979284"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:24.303405"], ["updated_at", "2020-12-22 13:30:24.303405"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:24.305732"], ["updated_at", "2020-12-22 13:30:24.305732"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:24.307958"], ["updated_at", "2020-12-22 13:30:24.307958"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:24.309956"], ["updated_at", "2020-12-22 13:30:24.309956"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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", "2020-12-22 13:30:24.315640"], ["updated_at", "2020-12-22 13:30:24.315640"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730224"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.319138"], ["updated_at", "2020-12-22 13:30:24.319138"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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", "2020-12-22 13:30:24.323855"], ["updated_at", "2020-12-22 13:30:24.323855"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557424"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.327118"], ["updated_at", "2020-12-22 13:30:24.327118"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.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", 1159], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:30:24.370038"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1159]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:24.374320"], ["updated_at", "2020-12-22 13:30:24.374320"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.379688"], ["updated_at", "2020-12-22 13:30:24.379688"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:30:24.409136"], ["updated_at", "2020-12-22 13:30:24.409136"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.438148"], ["updated_at", "2020-12-22 13:30:24.438148"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.441099"], ["updated_at", "2020-12-22 13:30:24.441099"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.448502"], ["updated_at", "2020-12-22 13:30:24.448502"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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", "2020-12-22 13:30:24.452769"], ["updated_at", "2020-12-22 13:30:24.452769"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:30:24.458472"], ["updated_at", "2020-12-22 13:30:24.458472"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:30:24.465064"], ["updated_at", "2020-12-22 13:30:24.465064"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.468581"], ["updated_at", "2020-12-22 13:30:24.468581"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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", "2020-12-22 13:30:24.475368"], ["updated_at", "2020-12-22 13:30:24.475368"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.479152"], ["updated_at", "2020-12-22 13:30:24.479152"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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", "2020-12-22 13:30:24.484518"], ["updated_at", "2020-12-22 13:30:24.484518"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.488542"], ["updated_at", "2020-12-22 13:30:24.488542"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.495757"], ["updated_at", "2020-12-22 13:30:24.495757"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.497948"], ["updated_at", "2020-12-22 13:30:24.497948"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1173], ["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", "2020-12-22 13:30:24.501839"], ["id", 1173]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.507080"], ["updated_at", "2020-12-22 13:30:24.507080"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.510318"], ["updated_at", "2020-12-22 13:30:24.510318"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1175], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:30:24.515620"], ["id", 1175]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1175], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.521864"], ["updated_at", "2020-12-22 13:30:24.521864"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.524613"], ["updated_at", "2020-12-22 13:30:24.524613"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1177], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:30:24.528384"], ["id", 1177]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1177], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.533758"], ["updated_at", "2020-12-22 13:30:24.533758"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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 (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.556326"], ["updated_at", "2020-12-22 13:30:24.556326"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:24.592036"], ["updated_at", "2020-12-22 13:30:24.592036"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.596487"], ["updated_at", "2020-12-22 13:30:24.596487"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.600407"], ["updated_at", "2020-12-22 13:30:24.600407"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:30:24.606761"], ["updated_at", "2020-12-22 13:30:24.606761"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1181], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1181], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:30:24.610701"], ["id", 1181]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1181], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 9.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (6.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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", "2020-12-22 13:30:24.707075"], ["updated_at", "2020-12-22 13:30:24.707075"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 37ms (ActiveRecord: 13.2ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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.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", "2020-12-22 13:30:24.724157"], ["updated_at", "2020-12-22 13:30:24.724157"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.7ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:24.732635"], ["updated_at", "2020-12-22 13:30:24.732635"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:30:24.744624"], ["updated_at", "2020-12-22 13:30:24.744624"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.4ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 3ms (Views: 3.0ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.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  (0.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 4ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (1.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (6.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.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.813344"], ["updated_at", "2020-12-22 13:30:24.813344"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (4.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) 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.3ms) 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", "2020-12-22 13:30:24.841578"], ["updated_at", "2020-12-22 13:30:24.841578"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.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 Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.857922"], ["updated_at", "2020-12-22 13:30:24.857922"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.868070"], ["updated_at", "2020-12-22 13:30:24.868070"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.884340"], ["updated_at", "2020-12-22 13:30:24.884340"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:24.896583"], ["updated_at", "2020-12-22 13:30:24.896583"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:24.911397"], ["updated_at", "2020-12-22 13:30:24.911397"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:24.917330"], ["updated_at", "2020-12-22 13:30:24.917330"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:24.920323"], ["updated_at", "2020-12-22 13:30:24.920323"], ["synced_id", 123], ["host", "test.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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", "2020-12-22 13:30:24.931942"], ["updated_at", "2020-12-22 13:30:24.931942"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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", "2020-12-22 13:30:24.944893"], ["updated_at", "2020-12-22 13:30:24.944893"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:24.949489"], ["updated_at", "2020-12-22 13:30:24.949489"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:24.954562"], ["updated_at", "2020-12-22 13:30:24.954562"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:24.975254"], ["updated_at", "2020-12-22 13:30:24.975254"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:24.996077"], ["updated_at", "2020-12-22 13:30:24.996077"], ["synced_id", 1]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:24.999497"], ["updated_at", "2020-12-22 13:30:24.999497"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:25.001385"], ["updated_at", "2020-12-22 13:30:25.001385"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:25.008332"], ["updated_at", "2020-12-22 13:30:25.008332"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:25.011298"], ["updated_at", "2020-12-22 13:30:25.011298"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) 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.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1212], ["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", "2020-12-22 13:30:25.015543"], ["id", 1212]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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", "2020-12-22 13:30:25.028359"], ["updated_at", "2020-12-22 13:30:25.028359"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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", "2020-12-22 13:30:25.031629"], ["updated_at", "2020-12-22 13:30:25.031629"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (6.2ms) 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 (9.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", "2020-12-22 13:30:25.052258"], ["id", 1214]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:25.068312"], ["updated_at", "2020-12-22 13:30:25.068312"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:25.071613"], ["updated_at", "2020-12-22 13:30:25.071613"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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.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", "2020-12-22 13:30:25.075497"], ["id", 1216]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1216], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (5.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:25.081650"], ["updated_at", "2020-12-22 13:30:25.081650"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:25.100312"], ["updated_at", "2020-12-22 13:30:25.100312"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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.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", "2020-12-22 13:30:25.104257"], ["id", 1218]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1218], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (3.0ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:25.114009"], ["updated_at", "2020-12-22 13:30:25.114009"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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.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", "2020-12-22 13:30:25.118927"], ["updated_at", "2020-12-22 13:30:25.118927"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:25.125109"], ["updated_at", "2020-12-22 13:30:25.125109"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:25.128273"], ["updated_at", "2020-12-22 13:30:25.128273"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:25.131916"], ["updated_at", "2020-12-22 13:30:25.131916"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.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", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 13:30:25.164338"], ["updated_at", "2020-12-22 13:30:25.164338"], ["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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:25.171823"], ["updated_at", "2020-12-22 13:30:25.171823"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:25.175095"], ["updated_at", "2020-12-22 13:30:25.175095"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:25.181397"], ["updated_at", "2020-12-22 13:30:25.181397"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1227], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1227], ["LIMIT", 1]] Account Update (0.2ms) 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", "2020-12-22 13:30:25.184485"], ["id", 1227]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1227], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:30:25.193479"], ["updated_at", "2020-12-22 13:30:25.193479"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:30:25.195270"], ["synced_id", 0], ["id", 1228]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (1.9ms) ROLLBACK  (2.4ms) 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 (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:25.213393"], ["updated_at", "2020-12-22 13:30:25.213393"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:25.218326"], ["updated_at", "2020-12-22 13:30:25.218326"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730225"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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", "2020-12-22 13:30:25.223308"], ["updated_at", "2020-12-22 13:30:25.223308"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557425"]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (3.9ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1231], ["LIMIT", 1]] Account Update (1.7ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:30:25.269500"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1231]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.8ms) BEGIN  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (3.0ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.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.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:40.527178"], ["updated_at", "2020-12-22 13:30:40.527178"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (4.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 (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.556735"], ["updated_at", "2020-12-22 13:30:40.556735"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.559838"], ["updated_at", "2020-12-22 13:30:40.559838"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) 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? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.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", "2020-12-22 13:30:40.591471"], ["updated_at", "2020-12-22 13:30:40.591471"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.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? (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:40.621201"], ["updated_at", "2020-12-22 13:30:40.621201"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:40.638633"], ["updated_at", "2020-12-22 13:30:40.638633"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:40.648571"], ["updated_at", "2020-12-22 13:30:40.648571"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:40.659169"], ["updated_at", "2020-12-22 13:30:40.659169"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:40.675430"], ["updated_at", "2020-12-22 13:30:40.675430"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 3) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 14ms (Views: 6.3ms | ActiveRecord: 0.0ms | Allocations: 1792)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms | Allocations: 165)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (Duration: 0.1ms | Allocations: 3) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 16ms (Views: 16.0ms | ActiveRecord: 0.0ms | Allocations: 366)  (0.7ms) ROLLBACK  (0.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 1ms (ActiveRecord: 0.0ms | Allocations: 108)  (0.7ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 170)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 118)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 2.6ms | Allocations: 262) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 14ms (Views: 5.7ms | ActiveRecord: 0.0ms | Allocations: 1927)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 0.2ms | Allocations: 54) 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 | Allocations: 426)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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.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", "2020-12-22 13:30:40.783251"], ["updated_at", "2020-12-22 13:30:40.783251"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.6ms | Allocations: 899)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:40.791738"], ["updated_at", "2020-12-22 13:30:40.791738"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.1ms | Allocations: 874)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.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.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", "2020-12-22 13:30:40.810275"], ["updated_at", "2020-12-22 13:30:40.810275"], ["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.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 2.7ms | Allocations: 976)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (2.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:40.826494"], ["updated_at", "2020-12-22 13:30:40.826494"], ["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: 1.8ms | Allocations: 882)  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.834127"], ["updated_at", "2020-12-22 13:30:40.834127"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:40.840326"], ["updated_at", "2020-12-22 13:30:40.840326"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.847101"], ["updated_at", "2020-12-22 13:30:40.847101"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:40.850284"], ["updated_at", "2020-12-22 13:30:40.850284"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.857489"], ["updated_at", "2020-12-22 13:30:40.857489"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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 (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", "2020-12-22 13:30:40.862495"], ["updated_at", "2020-12-22 13:30:40.862495"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.5ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.870266"], ["updated_at", "2020-12-22 13:30:40.870266"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:40.874094"], ["updated_at", "2020-12-22 13:30:40.874094"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.6ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.879972"], ["updated_at", "2020-12-22 13:30:40.879972"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.882957"], ["updated_at", "2020-12-22 13:30:40.882957"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) 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.3ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1245], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:30:40.888693"], ["id", 1245]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.893566"], ["updated_at", "2020-12-22 13:30:40.893566"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.895896"], ["updated_at", "2020-12-22 13:30:40.895896"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1247], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:30:40.920908"], ["id", 1247]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.925498"], ["updated_at", "2020-12-22 13:30:40.925498"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.927704"], ["updated_at", "2020-12-22 13:30:40.927704"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1249], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:30:40.931118"], ["id", 1249]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1249], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (2.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.938853"], ["updated_at", "2020-12-22 13:30:40.938853"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:40.942057"], ["updated_at", "2020-12-22 13:30:40.942057"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1251], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:30:40.946278"], ["id", 1251]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1251], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (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", "2020-12-22 13:30:40.955510"], ["updated_at", "2020-12-22 13:30:40.955510"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730240"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:40.962731"], ["updated_at", "2020-12-22 13:30:40.962731"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557440"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) 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", 1253], ["LIMIT", 1]] Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:30:41.012457"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1253]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:41.017393"], ["updated_at", "2020-12-22 13:30:41.017393"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:30:41.028147"], ["updated_at", "2020-12-22 13:30:41.028147"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:30:41.031224"], ["synced_id", 0], ["id", 1255]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (1.5ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:41.041671"], ["updated_at", "2020-12-22 13:30:41.041671"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:30:41.046261"], ["updated_at", "2020-12-22 13:30:41.046261"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1257], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1257], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:30:41.050604"], ["id", 1257]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1257], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:41.056578"], ["updated_at", "2020-12-22 13:30:41.056578"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:41.081188"], ["updated_at", "2020-12-22 13:30:41.081188"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.4ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:41.104543"], ["updated_at", "2020-12-22 13:30:41.104543"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:41.106501"], ["updated_at", "2020-12-22 13:30:41.106501"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:30:41.109197"], ["updated_at", "2020-12-22 13:30:41.109197"], ["synced_id", 3]]  (0.2ms) 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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (1.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) 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", "2020-12-22 13:30:41.148158"], ["updated_at", "2020-12-22 13:30:41.148158"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.180909"], ["updated_at", "2020-12-22 13:30:41.180909"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:41.188613"], ["updated_at", "2020-12-22 13:30:41.188613"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:41.191040"], ["updated_at", "2020-12-22 13:30:41.191040"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:41.195289"], ["updated_at", "2020-12-22 13:30:41.195289"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:41.198002"], ["updated_at", "2020-12-22 13:30:41.198002"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.7ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (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", "2020-12-22 13:30:41.209061"], ["updated_at", "2020-12-22 13:30:41.209061"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:41.216291"], ["updated_at", "2020-12-22 13:30:41.216291"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.3ms) 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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.221733"], ["updated_at", "2020-12-22 13:30:41.221733"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (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", "2020-12-22 13:30:41.226740"], ["updated_at", "2020-12-22 13:30:41.226740"], ["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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.234778"], ["updated_at", "2020-12-22 13:30:41.234778"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.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", "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", "2020-12-22 13:30:41.243914"], ["updated_at", "2020-12-22 13:30:41.243914"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.247510"], ["updated_at", "2020-12-22 13:30:41.247510"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) 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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1196], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:30:41.252250"], ["id", 1196]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.257483"], ["updated_at", "2020-12-22 13:30:41.257483"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.259634"], ["updated_at", "2020-12-22 13:30:41.259634"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.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"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1198], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:30:41.264016"], ["id", 1198]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1198], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.269161"], ["updated_at", "2020-12-22 13:30:41.269161"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.272201"], ["updated_at", "2020-12-22 13:30:41.272201"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1200], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:30:41.276236"], ["id", 1200]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1200], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.281067"], ["updated_at", "2020-12-22 13:30:41.281067"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.283722"], ["updated_at", "2020-12-22 13:30:41.283722"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (0.5ms) 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]]  (9.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.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", "2020-12-22 13:30:41.307308"], ["updated_at", "2020-12-22 13:30:41.307308"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.3ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:30:41.314255"], ["updated_at", "2020-12-22 13:30:41.314255"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.316508"], ["updated_at", "2020-12-22 13:30:41.316508"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:30:41.322001"], ["updated_at", "2020-12-22 13:30:41.322001"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.324854"], ["updated_at", "2020-12-22 13:30:41.324854"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:30:41.329214"], ["updated_at", "2020-12-22 13:30:41.329214"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.332724"], ["updated_at", "2020-12-22 13:30:41.332724"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:41.337296"], ["updated_at", "2020-12-22 13:30:41.337296"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.340920"], ["updated_at", "2020-12-22 13:30:41.340920"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) 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.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", "2020-12-22 13:30:41.367625"], ["updated_at", "2020-12-22 13:30:41.367625"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.6ms) 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", 1212], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1212], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:30:41.375413"], ["id", 1212]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1212], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.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", "2020-12-22 13:30:41.381134"], ["updated_at", "2020-12-22 13:30:41.381134"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730241"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.384799"], ["updated_at", "2020-12-22 13:30:41.384799"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 13:30:41.390403"], ["updated_at", "2020-12-22 13:30:41.390403"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557441"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.393809"], ["updated_at", "2020-12-22 13:30:41.393809"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1214], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:30:41.414862"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1214]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:30:41.419976"], ["updated_at", "2020-12-22 13:30:41.419976"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.423832"], ["updated_at", "2020-12-22 13:30:41.423832"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.427981"], ["updated_at", "2020-12-22 13:30:41.427981"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.433146"], ["updated_at", "2020-12-22 13:30:41.433146"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists? (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists? (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:30:41.444331"], ["updated_at", "2020-12-22 13:30:41.444331"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) 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]]  (0.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]] SQL (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", "2020-12-22 13:31:28.339085"], ["updated_at", "2020-12-22 13:31:28.339085"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 90ms (ActiveRecord: 22.7ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.359654"], ["updated_at", "2020-12-22 13:31:28.359654"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 8ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (3.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:31:28.406030"], ["updated_at", "2020-12-22 13:31:28.406030"], ["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.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 26ms (ActiveRecord: 2.9ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.425736"], ["updated_at", "2020-12-22 13:31:28.425736"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.2ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 15ms (Views: 13.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 16ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.482552"], ["updated_at", "2020-12-22 13:31:28.482552"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.485089"], ["updated_at", "2020-12-22 13:31:28.485089"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1268], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.488080"], ["id", 1268]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1268], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.493301"], ["updated_at", "2020-12-22 13:31:28.493301"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.495982"], ["updated_at", "2020-12-22 13:31:28.495982"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1270], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.498898"], ["id", 1270]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1270], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.502960"], ["updated_at", "2020-12-22 13:31:28.502960"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.506636"], ["updated_at", "2020-12-22 13:31:28.506636"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 1272], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.511579"], ["id", 1272]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.515696"], ["updated_at", "2020-12-22 13:31:28.515696"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.517782"], ["updated_at", "2020-12-22 13:31:28.517782"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1274], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.520976"], ["id", 1274]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.525690"], ["updated_at", "2020-12-22 13:31:28.525690"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.530191"], ["updated_at", "2020-12-22 13:31:28.530191"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.533889"], ["updated_at", "2020-12-22 13:31:28.533889"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.536797"], ["updated_at", "2020-12-22 13:31:28.536797"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.539932"], ["updated_at", "2020-12-22 13:31:28.539932"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.542983"], ["updated_at", "2020-12-22 13:31:28.542983"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.546497"], ["updated_at", "2020-12-22 13:31:28.546497"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.549029"], ["updated_at", "2020-12-22 13:31:28.549029"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:31:28.552297"], ["updated_at", "2020-12-22 13:31:28.552297"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:31:28.555639"], ["updated_at", "2020-12-22 13:31:28.555639"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:31:28.589986"], ["updated_at", "2020-12-22 13:31:28.589986"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.596001"], ["updated_at", "2020-12-22 13:31:28.596001"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:31:28.608051"], ["updated_at", "2020-12-22 13:31:28.608051"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:31:28.609683"], ["synced_id", 0], ["id", 1287]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.624308"], ["updated_at", "2020-12-22 13:31:28.624308"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1288], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1288], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.627747"], ["id", 1288]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1288], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:31:28.631720"], ["updated_at", "2020-12-22 13:31:28.631720"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.659182"], ["updated_at", "2020-12-22 13:31:28.659182"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730288"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.663109"], ["updated_at", "2020-12-22 13:31:28.663109"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557488"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1291], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:31:28.680441"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1291]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:31:28.683827"], ["updated_at", "2020-12-22 13:31:28.683827"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:31:28.686407"], ["updated_at", "2020-12-22 13:31:28.686407"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:31:28.688461"], ["updated_at", "2020-12-22 13:31:28.688461"], ["synced_id", 3]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "test.example"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.697660"], ["updated_at", "2020-12-22 13:31:28.697660"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (6.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.716221"], ["updated_at", "2020-12-22 13:31:28.716221"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.738374"], ["updated_at", "2020-12-22 13:31:28.738374"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:31:28.749158"], ["updated_at", "2020-12-22 13:31:28.749158"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1220], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1220], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.752478"], ["id", 1220]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1220], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.757131"], ["updated_at", "2020-12-22 13:31:28.757131"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.760693"], ["updated_at", "2020-12-22 13:31:28.760693"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.762725"], ["updated_at", "2020-12-22 13:31:28.762725"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.765002"], ["updated_at", "2020-12-22 13:31:28.765002"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.769386"], ["updated_at", "2020-12-22 13:31:28.769386"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.771628"], ["updated_at", "2020-12-22 13:31:28.771628"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.775026"], ["updated_at", "2020-12-22 13:31:28.775026"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.778080"], ["updated_at", "2020-12-22 13:31:28.778080"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1227], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.781143"], ["id", 1227]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.784634"], ["updated_at", "2020-12-22 13:31:28.784634"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.786659"], ["updated_at", "2020-12-22 13:31:28.786659"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1229], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.789602"], ["id", 1229]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1229], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.794141"], ["updated_at", "2020-12-22 13:31:28.794141"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.796556"], ["updated_at", "2020-12-22 13:31:28.796556"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1231], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.799774"], ["id", 1231]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1231], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.804197"], ["updated_at", "2020-12-22 13:31:28.804197"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.806287"], ["updated_at", "2020-12-22 13:31:28.806287"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:31:28.809850"], ["updated_at", "2020-12-22 13:31:28.809850"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:31:28.814729"], ["updated_at", "2020-12-22 13:31:28.814729"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.817234"], ["updated_at", "2020-12-22 13:31:28.817234"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:31:28.821343"], ["updated_at", "2020-12-22 13:31:28.821343"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.823408"], ["updated_at", "2020-12-22 13:31:28.823408"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:31:28.827312"], ["updated_at", "2020-12-22 13:31:28.827312"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.829646"], ["updated_at", "2020-12-22 13:31:28.829646"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.833257"], ["updated_at", "2020-12-22 13:31:28.833257"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.838725"], ["updated_at", "2020-12-22 13:31:28.838725"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.843773"], ["updated_at", "2020-12-22 13:31:28.843773"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.850112"], ["updated_at", "2020-12-22 13:31:28.850112"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.855821"], ["updated_at", "2020-12-22 13:31:28.855821"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.860758"], ["updated_at", "2020-12-22 13:31:28.860758"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:31:28.864627"], ["updated_at", "2020-12-22 13:31:28.864627"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:31:28.868565"], ["updated_at", "2020-12-22 13:31:28.868565"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557488"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.871907"], ["updated_at", "2020-12-22 13:31:28.871907"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1245], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:31:28.889209"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1245]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:31:28.893212"], ["updated_at", "2020-12-22 13:31:28.893212"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730288"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.896592"], ["updated_at", "2020-12-22 13:31:28.896592"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.902259"], ["updated_at", "2020-12-22 13:31:28.902259"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.911277"], ["updated_at", "2020-12-22 13:31:28.911277"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.918878"], ["updated_at", "2020-12-22 13:31:28.918878"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.931248"], ["updated_at", "2020-12-22 13:31:28.931248"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.943224"], ["updated_at", "2020-12-22 13:31:28.943224"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:28.951633"], ["updated_at", "2020-12-22 13:31:28.951633"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:31:28.980663"], ["updated_at", "2020-12-22 13:31:28.980663"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.986448"], ["updated_at", "2020-12-22 13:31:28.986448"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:31:28.989107"], ["updated_at", "2020-12-22 13:31:28.989107"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.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 5ms (Views: 4.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:31:29.016472"], ["updated_at", "2020-12-22 13:31:29.016472"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) 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]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:32:43.743794"], ["updated_at", "2020-12-22 13:32:43.743794"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 76ms (ActiveRecord: 19.6ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 13:32:43.969460"], ["updated_at", "2020-12-22 13:32:43.969460"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 1.7ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (3.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:32:44.020148"], ["updated_at", "2020-12-22 13:32:44.020148"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 33ms (ActiveRecord: 3.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.037496"], ["updated_at", "2020-12-22 13:32:44.037496"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.9ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 16ms (Views: 13.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.086970"], ["updated_at", "2020-12-22 13:32:44.086970"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one 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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.091654"], ["updated_at", "2020-12-22 13:32:44.091654"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:32:44.121005"], ["updated_at", "2020-12-22 13:32:44.121005"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (4.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.144236"], ["updated_at", "2020-12-22 13:32:44.144236"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.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 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.185598"], ["updated_at", "2020-12-22 13:32:44.185598"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.202170"], ["updated_at", "2020-12-22 13:32:44.202170"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.217056"], ["updated_at", "2020-12-22 13:32:44.217056"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.230767"], ["updated_at", "2020-12-22 13:32:44.230767"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.240252"], ["updated_at", "2020-12-22 13:32:44.240252"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.249553"], ["updated_at", "2020-12-22 13:32:44.249553"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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]]  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.278917"], ["updated_at", "2020-12-22 13:32:44.278917"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.284651"], ["updated_at", "2020-12-22 13:32:44.284651"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.321328"], ["updated_at", "2020-12-22 13:32:44.321328"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.325233"], ["updated_at", "2020-12-22 13:32:44.325233"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.328327"], ["updated_at", "2020-12-22 13:32:44.328327"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.333516"], ["updated_at", "2020-12-22 13:32:44.333516"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.335635"], ["updated_at", "2020-12-22 13:32:44.335635"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.337951"], ["updated_at", "2020-12-22 13:32:44.337951"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.340121"], ["updated_at", "2020-12-22 13:32:44.340121"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.344206"], ["updated_at", "2020-12-22 13:32:44.344206"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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 (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:32:44.357308"], ["updated_at", "2020-12-22 13:32:44.357308"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:32:44.365573"], ["updated_at", "2020-12-22 13:32:44.365573"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1260], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1260], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.369501"], ["id", 1260]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1260], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:32:44.374077"], ["updated_at", "2020-12-22 13:32:44.374077"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730364"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.377957"], ["updated_at", "2020-12-22 13:32:44.377957"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.384626"], ["updated_at", "2020-12-22 13:32:44.384626"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557564"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.389727"], ["updated_at", "2020-12-22 13:32:44.389727"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.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"."id" != $2) AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1262], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:32:44.416935"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1262]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.422779"], ["updated_at", "2020-12-22 13:32:44.422779"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.451793"], ["updated_at", "2020-12-22 13:32:44.451793"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.454317"], ["updated_at", "2020-12-22 13:32:44.454317"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.458135"], ["updated_at", "2020-12-22 13:32:44.458135"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.460259"], ["updated_at", "2020-12-22 13:32:44.460259"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1265], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.463202"], ["id", 1265]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.467751"], ["updated_at", "2020-12-22 13:32:44.467751"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.469887"], ["updated_at", "2020-12-22 13:32:44.469887"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1267], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.473028"], ["id", 1267]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1267], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.476995"], ["updated_at", "2020-12-22 13:32:44.476995"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.480041"], ["updated_at", "2020-12-22 13:32:44.480041"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1269], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.484082"], ["id", 1269]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1269], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.489023"], ["updated_at", "2020-12-22 13:32:44.489023"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.491442"], ["updated_at", "2020-12-22 13:32:44.491442"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:32:44.495171"], ["updated_at", "2020-12-22 13:32:44.495171"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:32:44.501311"], ["updated_at", "2020-12-22 13:32:44.501311"], ["provider", "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.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.506223"], ["updated_at", "2020-12-22 13:32:44.506223"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:32:44.511352"], ["updated_at", "2020-12-22 13:32:44.511352"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:32:44.515177"], ["updated_at", "2020-12-22 13:32:44.515177"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (1.2ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:32:44.523926"], ["updated_at", "2020-12-22 13:32:44.523926"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:32:44.527232"], ["updated_at", "2020-12-22 13:32:44.527232"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.537517"], ["updated_at", "2020-12-22 13:32:44.537517"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:32:44.544343"], ["updated_at", "2020-12-22 13:32:44.544343"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:32:44.550482"], ["updated_at", "2020-12-22 13:32:44.550482"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:32:44.553541"], ["updated_at", "2020-12-22 13:32:44.553541"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:32:44.555547"], ["updated_at", "2020-12-22 13:32:44.555547"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:32:44.559022"], ["updated_at", "2020-12-22 13:32:44.559022"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:32:44.579179"], ["updated_at", "2020-12-22 13:32:44.579179"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.585482"], ["updated_at", "2020-12-22 13:32:44.585482"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.592398"], ["updated_at", "2020-12-22 13:32:44.592398"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.596915"], ["updated_at", "2020-12-22 13:32:44.596915"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.602685"], ["updated_at", "2020-12-22 13:32:44.602685"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.606706"], ["updated_at", "2020-12-22 13:32:44.606706"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.610548"], ["updated_at", "2020-12-22 13:32:44.610548"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.613891"], ["updated_at", "2020-12-22 13:32:44.613891"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.617879"], ["updated_at", "2020-12-22 13:32:44.617879"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.621270"], ["updated_at", "2020-12-22 13:32:44.621270"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.624634"], ["updated_at", "2020-12-22 13:32:44.624634"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.626898"], ["updated_at", "2020-12-22 13:32:44.626898"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1315], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.630050"], ["id", 1315]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1315], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.636797"], ["updated_at", "2020-12-22 13:32:44.636797"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.638922"], ["updated_at", "2020-12-22 13:32:44.638922"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1317], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.641848"], ["id", 1317]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1317], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.646855"], ["updated_at", "2020-12-22 13:32:44.646855"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.650266"], ["updated_at", "2020-12-22 13:32:44.650266"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1319], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.656390"], ["id", 1319]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.662199"], ["updated_at", "2020-12-22 13:32:44.662199"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:32:44.667787"], ["updated_at", "2020-12-22 13:32:44.667787"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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", 1321], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.674731"], ["id", 1321]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:32:44.679788"], ["updated_at", "2020-12-22 13:32:44.679788"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557564"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1322], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:32:44.700580"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1322]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.704435"], ["updated_at", "2020-12-22 13:32:44.704435"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730364"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:32:44.713627"], ["updated_at", "2020-12-22 13:32:44.713627"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:32:44.715409"], ["synced_id", 0], ["id", 1324]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:32:44.722019"], ["updated_at", "2020-12-22 13:32:44.722019"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.725405"], ["updated_at", "2020-12-22 13:32:44.725405"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1326], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1326], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:32:44.728301"], ["id", 1326]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1326], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:32:44.734166"], ["updated_at", "2020-12-22 13:32:44.734166"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (4.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.234334"], ["updated_at", "2020-12-22 13:33:18.234334"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.474595"], ["updated_at", "2020-12-22 13:33:18.474595"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.487273"], ["updated_at", "2020-12-22 13:33:18.487273"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.500210"], ["updated_at", "2020-12-22 13:33:18.500210"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.510706"], ["updated_at", "2020-12-22 13:33:18.510706"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.519746"], ["updated_at", "2020-12-22 13:33:18.519746"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (4.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]] SQL (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.542088"], ["updated_at", "2020-12-22 13:33:18.542088"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.545962"], ["updated_at", "2020-12-22 13:33:18.545962"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.549098"], ["updated_at", "2020-12-22 13:33:18.549098"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.558325"], ["updated_at", "2020-12-22 13:33:18.558325"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.567755"], ["updated_at", "2020-12-22 13:33:18.567755"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.570896"], ["updated_at", "2020-12-22 13:33:18.570896"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:33:18.577435"], ["updated_at", "2020-12-22 13:33:18.577435"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557598"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.580459"], ["updated_at", "2020-12-22 13:33:18.580459"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.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"."id" != $2) AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1284], ["host", "example.test"], ["LIMIT", 1]] SQL (0.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:33:18.619415"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1284]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:33:18.625134"], ["updated_at", "2020-12-22 13:33:18.625134"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730398"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.631381"], ["updated_at", "2020-12-22 13:33:18.631381"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.639716"], ["updated_at", "2020-12-22 13:33:18.639716"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.675623"], ["updated_at", "2020-12-22 13:33:18.675623"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.678093"], ["updated_at", "2020-12-22 13:33:18.678093"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.679941"], ["updated_at", "2020-12-22 13:33:18.679941"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.682186"], ["updated_at", "2020-12-22 13:33:18.682186"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:33:18.687004"], ["updated_at", "2020-12-22 13:33:18.687004"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:33:18.696933"], ["updated_at", "2020-12-22 13:33:18.696933"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1291], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1291], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.700685"], ["id", 1291]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1291], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.705212"], ["updated_at", "2020-12-22 13:33:18.705212"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.707655"], ["updated_at", "2020-12-22 13:33:18.707655"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1292], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.711348"], ["id", 1292]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.718013"], ["updated_at", "2020-12-22 13:33:18.718013"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.720278"], ["updated_at", "2020-12-22 13:33:18.720278"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1294], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.723452"], ["id", 1294]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1294], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.728321"], ["updated_at", "2020-12-22 13:33:18.728321"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.730278"], ["updated_at", "2020-12-22 13:33:18.730278"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1296], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.733191"], ["id", 1296]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1296], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.737622"], ["updated_at", "2020-12-22 13:33:18.737622"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.739894"], ["updated_at", "2020-12-22 13:33:18.739894"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:33:18.744063"], ["updated_at", "2020-12-22 13:33:18.744063"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:33:18.748508"], ["updated_at", "2020-12-22 13:33:18.748508"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.750916"], ["updated_at", "2020-12-22 13:33:18.750916"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) 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]] SQL (0.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", "2020-12-22 13:33:18.756040"], ["updated_at", "2020-12-22 13:33:18.756040"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.759116"], ["updated_at", "2020-12-22 13:33:18.759116"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:33:18.763973"], ["updated_at", "2020-12-22 13:33:18.763973"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.766939"], ["updated_at", "2020-12-22 13:33:18.766939"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.770912"], ["updated_at", "2020-12-22 13:33:18.770912"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:33:18.773732"], ["updated_at", "2020-12-22 13:33:18.773732"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.780899"], ["updated_at", "2020-12-22 13:33:18.780899"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.785043"], ["updated_at", "2020-12-22 13:33:18.785043"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:33:18.806642"], ["updated_at", "2020-12-22 13:33:18.806642"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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]] SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:33:18.861055"], ["updated_at", "2020-12-22 13:33:18.861055"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.865062"], ["updated_at", "2020-12-22 13:33:18.865062"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.868948"], ["updated_at", "2020-12-22 13:33:18.868948"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.872332"], ["updated_at", "2020-12-22 13:33:18.872332"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.875428"], ["updated_at", "2020-12-22 13:33:18.875428"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.878776"], ["updated_at", "2020-12-22 13:33:18.878776"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.881026"], ["updated_at", "2020-12-22 13:33:18.881026"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.884064"], ["updated_at", "2020-12-22 13:33:18.884064"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.886461"], ["updated_at", "2020-12-22 13:33:18.886461"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.890308"], ["updated_at", "2020-12-22 13:33:18.890308"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.892676"], ["updated_at", "2020-12-22 13:33:18.892676"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1338], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.895246"], ["id", 1338]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.898507"], ["updated_at", "2020-12-22 13:33:18.898507"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.900171"], ["updated_at", "2020-12-22 13:33:18.900171"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1340], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.903849"], ["id", 1340]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1340], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.908554"], ["updated_at", "2020-12-22 13:33:18.908554"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.910306"], ["updated_at", "2020-12-22 13:33:18.910306"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1342], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.913233"], ["id", 1342]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1342], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.917419"], ["updated_at", "2020-12-22 13:33:18.917419"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:18.919669"], ["updated_at", "2020-12-22 13:33:18.919669"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1344], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.922188"], ["id", 1344]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.925729"], ["updated_at", "2020-12-22 13:33:18.925729"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.931342"], ["updated_at", "2020-12-22 13:33:18.931342"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730398"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:18.934835"], ["updated_at", "2020-12-22 13:33:18.934835"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557598"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1347], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:33:18.951164"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1347]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:33:18.954635"], ["updated_at", "2020-12-22 13:33:18.954635"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:33:18.956471"], ["updated_at", "2020-12-22 13:33:18.956471"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:33:18.958818"], ["updated_at", "2020-12-22 13:33:18.958818"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:33:18.963270"], ["updated_at", "2020-12-22 13:33:18.963270"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:33:18.981141"], ["updated_at", "2020-12-22 13:33:18.981141"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:33:18.985388"], ["updated_at", "2020-12-22 13:33:18.985388"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:33:18.994499"], ["updated_at", "2020-12-22 13:33:18.994499"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:33:18.995791"], ["synced_id", 0], ["id", 1354]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:19.001644"], ["updated_at", "2020-12-22 13:33:19.001644"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1355], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1355], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 13:33:19.004245"], ["id", 1355]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1355], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:33:19.024058"], ["updated_at", "2020-12-22 13:33:19.024058"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:19.029897"], ["updated_at", "2020-12-22 13:33:19.029897"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:33:19.032292"], ["updated_at", "2020-12-22 13:33:19.032292"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 4ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 4ms (Views: 2.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:33:19.092211"], ["updated_at", "2020-12-22 13:33:19.092211"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:19.097910"], ["updated_at", "2020-12-22 13:33:19.097910"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:33:19.103956"], ["updated_at", "2020-12-22 13:33:19.103956"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.7ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:33:19.112252"], ["updated_at", "2020-12-22 13:33:19.112252"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.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 28ms (Views: 27.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.1ms) ROLLBACK  (0.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 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 5ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (3.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:06.823739"], ["updated_at", "2020-12-22 13:34:06.823739"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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", "test.example"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:06.884156"], ["updated_at", "2020-12-22 13:34:06.884156"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:06.888642"], ["updated_at", "2020-12-22 13:34:06.888642"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:06.917843"], ["updated_at", "2020-12-22 13:34:06.917843"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:06.930470"], ["updated_at", "2020-12-22 13:34:06.930470"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:06.933956"], ["updated_at", "2020-12-22 13:34:06.933956"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:06.936926"], ["updated_at", "2020-12-22 13:34:06.936926"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:06.939492"], ["updated_at", "2020-12-22 13:34:06.939492"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:06.944199"], ["updated_at", "2020-12-22 13:34:06.944199"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) 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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:06.974877"], ["updated_at", "2020-12-22 13:34:06.974877"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730446"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:06.979423"], ["updated_at", "2020-12-22 13:34:06.979423"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:06.983890"], ["updated_at", "2020-12-22 13:34:06.983890"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557646"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:06.987971"], ["updated_at", "2020-12-22 13:34:06.987971"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1321], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:34:07.007182"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1321]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.011008"], ["updated_at", "2020-12-22 13:34:07.011008"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.014024"], ["updated_at", "2020-12-22 13:34:07.014024"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.017140"], ["updated_at", "2020-12-22 13:34:07.017140"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:07.022029"], ["updated_at", "2020-12-22 13:34:07.022029"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1323], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1323], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.025749"], ["id", 1323]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1323], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.029926"], ["updated_at", "2020-12-22 13:34:07.029926"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.033338"], ["updated_at", "2020-12-22 13:34:07.033338"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.039185"], ["updated_at", "2020-12-22 13:34:07.039185"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.041805"], ["updated_at", "2020-12-22 13:34:07.041805"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.049587"], ["updated_at", "2020-12-22 13:34:07.049587"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.051773"], ["updated_at", "2020-12-22 13:34:07.051773"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1327], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.056021"], ["id", 1327]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.062168"], ["updated_at", "2020-12-22 13:34:07.062168"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.064498"], ["updated_at", "2020-12-22 13:34:07.064498"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1329], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.067576"], ["id", 1329]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1329], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.072648"], ["updated_at", "2020-12-22 13:34:07.072648"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.074966"], ["updated_at", "2020-12-22 13:34:07.074966"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1331], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.077803"], ["id", 1331]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1331], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.081878"], ["updated_at", "2020-12-22 13:34:07.081878"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.083894"], ["updated_at", "2020-12-22 13:34:07.083894"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:07.088603"], ["updated_at", "2020-12-22 13:34:07.088603"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:07.093205"], ["updated_at", "2020-12-22 13:34:07.093205"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.095356"], ["updated_at", "2020-12-22 13:34:07.095356"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:07.099841"], ["updated_at", "2020-12-22 13:34:07.099841"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.102028"], ["updated_at", "2020-12-22 13:34:07.102028"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:07.106694"], ["updated_at", "2020-12-22 13:34:07.106694"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.108861"], ["updated_at", "2020-12-22 13:34:07.108861"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.139630"], ["updated_at", "2020-12-22 13:34:07.139630"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.142111"], ["updated_at", "2020-12-22 13:34:07.142111"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:07.158352"], ["updated_at", "2020-12-22 13:34:07.158352"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 13:34:07.186391"], ["updated_at", "2020-12-22 13:34:07.186391"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.5ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.192706"], ["updated_at", "2020-12-22 13:34:07.192706"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:07.220785"], ["updated_at", "2020-12-22 13:34:07.220785"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 25ms (ActiveRecord: 1.2ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.230632"], ["updated_at", "2020-12-22 13:34:07.230632"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:07.245554"], ["updated_at", "2020-12-22 13:34:07.245554"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:07.247262"], ["updated_at", "2020-12-22 13:34:07.247262"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:07.248997"], ["updated_at", "2020-12-22 13:34:07.248997"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.253114"], ["updated_at", "2020-12-22 13:34:07.253114"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.255793"], ["updated_at", "2020-12-22 13:34:07.255793"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1368], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.258453"], ["id", 1368]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.262500"], ["updated_at", "2020-12-22 13:34:07.262500"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.264992"], ["updated_at", "2020-12-22 13:34:07.264992"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1370], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.268606"], ["id", 1370]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1370], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.273904"], ["updated_at", "2020-12-22 13:34:07.273904"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.276112"], ["updated_at", "2020-12-22 13:34:07.276112"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1372], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.278699"], ["id", 1372]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1372], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.282802"], ["updated_at", "2020-12-22 13:34:07.282802"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.284758"], ["updated_at", "2020-12-22 13:34:07.284758"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1374], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.287824"], ["id", 1374]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.291408"], ["updated_at", "2020-12-22 13:34:07.291408"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.294108"], ["updated_at", "2020-12-22 13:34:07.294108"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.297538"], ["updated_at", "2020-12-22 13:34:07.297538"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.300166"], ["updated_at", "2020-12-22 13:34:07.300166"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.303945"], ["updated_at", "2020-12-22 13:34:07.303945"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.306671"], ["updated_at", "2020-12-22 13:34:07.306671"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:07.309905"], ["updated_at", "2020-12-22 13:34:07.309905"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.312233"], ["updated_at", "2020-12-22 13:34:07.312233"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.316018"], ["updated_at", "2020-12-22 13:34:07.316018"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557647"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1383], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:34:07.337886"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1383]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.341789"], ["updated_at", "2020-12-22 13:34:07.341789"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730447"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:07.345010"], ["updated_at", "2020-12-22 13:34:07.345010"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:07.350082"], ["updated_at", "2020-12-22 13:34:07.350082"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:07.369588"], ["updated_at", "2020-12-22 13:34:07.369588"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:34:07.381158"], ["updated_at", "2020-12-22 13:34:07.381158"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:34:07.382513"], ["synced_id", 0], ["id", 1388]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:07.388806"], ["updated_at", "2020-12-22 13:34:07.388806"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.392370"], ["updated_at", "2020-12-22 13:34:07.392370"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:07.395988"], ["updated_at", "2020-12-22 13:34:07.395988"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1391], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1391], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 13:34:07.398818"], ["id", 1391]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1391], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.412989"], ["updated_at", "2020-12-22 13:34:07.412989"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.420568"], ["updated_at", "2020-12-22 13:34:07.420568"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.433901"], ["updated_at", "2020-12-22 13:34:07.433901"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.443263"], ["updated_at", "2020-12-22 13:34:07.443263"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.451625"], ["updated_at", "2020-12-22 13:34:07.451625"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.461498"], ["updated_at", "2020-12-22 13:34:07.461498"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:07.474323"], ["updated_at", "2020-12-22 13:34:07.474323"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (4.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.239045"], ["updated_at", "2020-12-22 13:34:52.239045"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 9.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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]]  (0.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]] SQL (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", "2020-12-22 13:34:52.351851"], ["updated_at", "2020-12-22 13:34:52.351851"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 36ms (ActiveRecord: 19.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.359209"], ["updated_at", "2020-12-22 13:34:52.359209"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (3.9ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:34:52.386320"], ["updated_at", "2020-12-22 13:34:52.386320"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 3.3ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:34:52.396827"], ["updated_at", "2020-12-22 13:34:52.396827"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:52.434501"], ["updated_at", "2020-12-22 13:34:52.434501"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:52.475437"], ["updated_at", "2020-12-22 13:34:52.475437"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:52.477458"], ["updated_at", "2020-12-22 13:34:52.477458"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:52.480557"], ["updated_at", "2020-12-22 13:34:52.480557"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.485963"], ["updated_at", "2020-12-22 13:34:52.485963"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.488250"], ["updated_at", "2020-12-22 13:34:52.488250"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1400], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.491133"], ["id", 1400]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1400], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.498001"], ["updated_at", "2020-12-22 13:34:52.498001"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.500211"], ["updated_at", "2020-12-22 13:34:52.500211"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1402], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.503194"], ["id", 1402]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1402], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.507519"], ["updated_at", "2020-12-22 13:34:52.507519"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.509324"], ["updated_at", "2020-12-22 13:34:52.509324"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1404], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.512986"], ["id", 1404]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.516259"], ["updated_at", "2020-12-22 13:34:52.516259"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.518359"], ["updated_at", "2020-12-22 13:34:52.518359"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1406], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.521114"], ["id", 1406]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.524403"], ["updated_at", "2020-12-22 13:34:52.524403"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.527262"], ["updated_at", "2020-12-22 13:34:52.527262"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.531653"], ["updated_at", "2020-12-22 13:34:52.531653"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.534130"], ["updated_at", "2020-12-22 13:34:52.534130"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.538048"], ["updated_at", "2020-12-22 13:34:52.538048"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) 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.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:34:52.546766"], ["updated_at", "2020-12-22 13:34:52.546766"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.551688"], ["updated_at", "2020-12-22 13:34:52.551688"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.556029"], ["updated_at", "2020-12-22 13:34:52.556029"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:34:52.569814"], ["updated_at", "2020-12-22 13:34:52.569814"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:34:52.571717"], ["synced_id", 0], ["id", 1415]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.586943"], ["updated_at", "2020-12-22 13:34:52.586943"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557692"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1416], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:34:52.615690"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1416]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.619371"], ["updated_at", "2020-12-22 13:34:52.619371"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730492"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:52.623600"], ["updated_at", "2020-12-22 13:34:52.623600"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.626990"], ["updated_at", "2020-12-22 13:34:52.626990"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:52.635136"], ["updated_at", "2020-12-22 13:34:52.635136"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:52.656024"], ["updated_at", "2020-12-22 13:34:52.656024"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.660460"], ["updated_at", "2020-12-22 13:34:52.660460"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1422], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1422], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 13:34:52.664431"], ["id", 1422]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1422], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.675572"], ["updated_at", "2020-12-22 13:34:52.675572"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.679754"], ["updated_at", "2020-12-22 13:34:52.679754"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:34:52.687406"], ["updated_at", "2020-12-22 13:34:52.687406"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.717818"], ["updated_at", "2020-12-22 13:34:52.717818"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.722504"], ["updated_at", "2020-12-22 13:34:52.722504"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.727927"], ["updated_at", "2020-12-22 13:34:52.727927"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.733553"], ["updated_at", "2020-12-22 13:34:52.733553"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.736871"], ["updated_at", "2020-12-22 13:34:52.736871"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.756081"], ["updated_at", "2020-12-22 13:34:52.756081"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.758528"], ["updated_at", "2020-12-22 13:34:52.758528"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1350], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.766158"], ["id", 1350]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.770797"], ["updated_at", "2020-12-22 13:34:52.770797"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.773050"], ["updated_at", "2020-12-22 13:34:52.773050"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1352], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.776380"], ["id", 1352]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1352], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.781732"], ["updated_at", "2020-12-22 13:34:52.781732"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.784091"], ["updated_at", "2020-12-22 13:34:52.784091"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1354], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.787424"], ["id", 1354]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1354], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.791867"], ["updated_at", "2020-12-22 13:34:52.791867"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.793846"], ["updated_at", "2020-12-22 13:34:52.793846"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:52.798536"], ["updated_at", "2020-12-22 13:34:52.798536"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:52.802973"], ["updated_at", "2020-12-22 13:34:52.802973"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.805025"], ["updated_at", "2020-12-22 13:34:52.805025"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:52.809356"], ["updated_at", "2020-12-22 13:34:52.809356"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.811643"], ["updated_at", "2020-12-22 13:34:52.811643"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:52.816097"], ["updated_at", "2020-12-22 13:34:52.816097"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.818074"], ["updated_at", "2020-12-22 13:34:52.818074"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.821519"], ["updated_at", "2020-12-22 13:34:52.821519"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.823641"], ["updated_at", "2020-12-22 13:34:52.823641"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.826914"], ["updated_at", "2020-12-22 13:34:52.826914"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.831640"], ["updated_at", "2020-12-22 13:34:52.831640"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.835195"], ["updated_at", "2020-12-22 13:34:52.835195"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:52.839397"], ["updated_at", "2020-12-22 13:34:52.839397"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557692"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.842376"], ["updated_at", "2020-12-22 13:34:52.842376"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1368], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:34:52.861110"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1368]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:52.864758"], ["updated_at", "2020-12-22 13:34:52.864758"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730492"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.868788"], ["updated_at", "2020-12-22 13:34:52.868788"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.872853"], ["updated_at", "2020-12-22 13:34:52.872853"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.882331"], ["updated_at", "2020-12-22 13:34:52.882331"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.884289"], ["updated_at", "2020-12-22 13:34:52.884289"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.886882"], ["updated_at", "2020-12-22 13:34:52.886882"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:34:52.888886"], ["updated_at", "2020-12-22 13:34:52.888886"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:52.892890"], ["updated_at", "2020-12-22 13:34:52.892890"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:34:52.897209"], ["updated_at", "2020-12-22 13:34:52.897209"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1376], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1376], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:34:52.900414"], ["id", 1376]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1376], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.905856"], ["updated_at", "2020-12-22 13:34:52.905856"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.918966"], ["updated_at", "2020-12-22 13:34:52.918966"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.926564"], ["updated_at", "2020-12-22 13:34:52.926564"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.934584"], ["updated_at", "2020-12-22 13:34:52.934584"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.946668"], ["updated_at", "2020-12-22 13:34:52.946668"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:34:52.958649"], ["updated_at", "2020-12-22 13:34:52.958649"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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 19ms (Views: 18.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.1ms) ROLLBACK  (0.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 5ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:36:56.955339"], ["updated_at", "2020-12-22 13:36:56.955339"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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", 123], ["host", "example.host"], ["LIMIT", 1]] SQL (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:56.997971"], ["updated_at", "2020-12-22 13:36:56.997971"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.003251"], ["updated_at", "2020-12-22 13:36:57.003251"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 13:36:57.066113"], ["updated_at", "2020-12-22 13:36:57.066113"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 26ms (ActiveRecord: 1.6ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.071925"], ["updated_at", "2020-12-22 13:36:57.071925"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:36:57.086236"], ["updated_at", "2020-12-22 13:36:57.086236"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.095782"], ["updated_at", "2020-12-22 13:36:57.095782"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 4ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.6ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.133695"], ["updated_at", "2020-12-22 13:36:57.133695"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.135822"], ["updated_at", "2020-12-22 13:36:57.135822"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.137612"], ["updated_at", "2020-12-22 13:36:57.137612"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.139513"], ["updated_at", "2020-12-22 13:36:57.139513"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:36:57.145815"], ["updated_at", "2020-12-22 13:36:57.145815"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1384], ["LIMIT", 1]]  (0.3ms) 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"."id" != $1) AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1384], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.154156"], ["id", 1384]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1384], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:36:57.160551"], ["updated_at", "2020-12-22 13:36:57.160551"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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 (0.2ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.183508"], ["updated_at", "2020-12-22 13:36:57.183508"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.185856"], ["updated_at", "2020-12-22 13:36:57.185856"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:36:57.188971"], ["updated_at", "2020-12-22 13:36:57.188971"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:36:57.195380"], ["updated_at", "2020-12-22 13:36:57.195380"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.197513"], ["updated_at", "2020-12-22 13:36:57.197513"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:36:57.201671"], ["updated_at", "2020-12-22 13:36:57.201671"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.204085"], ["updated_at", "2020-12-22 13:36:57.204085"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:36:57.208574"], ["updated_at", "2020-12-22 13:36:57.208574"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.211988"], ["updated_at", "2020-12-22 13:36:57.211988"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.215601"], ["updated_at", "2020-12-22 13:36:57.215601"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.218080"], ["updated_at", "2020-12-22 13:36:57.218080"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1395], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.221121"], ["id", 1395]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:36:57.226500"], ["updated_at", "2020-12-22 13:36:57.226500"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.230021"], ["updated_at", "2020-12-22 13:36:57.230021"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1397], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.232770"], ["id", 1397]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1397], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.237082"], ["updated_at", "2020-12-22 13:36:57.237082"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.239056"], ["updated_at", "2020-12-22 13:36:57.239056"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1399], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.242795"], ["id", 1399]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1399], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:36:57.248034"], ["updated_at", "2020-12-22 13:36:57.248034"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.250474"], ["updated_at", "2020-12-22 13:36:57.250474"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:36:57.253860"], ["updated_at", "2020-12-22 13:36:57.253860"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.258266"], ["updated_at", "2020-12-22 13:36:57.258266"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.266329"], ["updated_at", "2020-12-22 13:36:57.266329"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.304732"], ["updated_at", "2020-12-22 13:36:57.304732"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.360804"], ["updated_at", "2020-12-22 13:36:57.360804"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) 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]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.365804"], ["updated_at", "2020-12-22 13:36:57.365804"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) 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.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:36:57.373840"], ["updated_at", "2020-12-22 13:36:57.373840"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557817"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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 (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.379419"], ["updated_at", "2020-12-22 13:36:57.379419"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) 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"."id" != $2) AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1406], ["host", "example.test"], ["LIMIT", 1]] SQL (0.6ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:36:57.410763"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1406]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.420369"], ["updated_at", "2020-12-22 13:36:57.420369"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730617"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.429205"], ["updated_at", "2020-12-22 13:36:57.429205"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.434929"], ["updated_at", "2020-12-22 13:36:57.434929"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (7.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.446965"], ["updated_at", "2020-12-22 13:36:57.446965"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.452137"], ["updated_at", "2020-12-22 13:36:57.452137"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.457124"], ["updated_at", "2020-12-22 13:36:57.457124"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1428], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1428], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.462264"], ["id", 1428]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1428], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:36:57.472687"], ["updated_at", "2020-12-22 13:36:57.472687"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:36:57.474526"], ["synced_id", 0], ["id", 1429]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:36:57.483582"], ["updated_at", "2020-12-22 13:36:57.483582"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.487212"], ["updated_at", "2020-12-22 13:36:57.487212"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.490948"], ["updated_at", "2020-12-22 13:36:57.490948"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.496111"], ["updated_at", "2020-12-22 13:36:57.496111"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.498665"], ["updated_at", "2020-12-22 13:36:57.498665"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.503746"], ["updated_at", "2020-12-22 13:36:57.503746"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:36:57.507445"], ["updated_at", "2020-12-22 13:36:57.507445"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.511724"], ["updated_at", "2020-12-22 13:36:57.511724"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.514679"], ["updated_at", "2020-12-22 13:36:57.514679"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.518796"], ["updated_at", "2020-12-22 13:36:57.518796"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.520799"], ["updated_at", "2020-12-22 13:36:57.520799"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1440], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.523955"], ["id", 1440]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.528905"], ["updated_at", "2020-12-22 13:36:57.528905"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.531120"], ["updated_at", "2020-12-22 13:36:57.531120"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1442], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.536264"], ["id", 1442]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.542619"], ["updated_at", "2020-12-22 13:36:57.542619"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.546829"], ["updated_at", "2020-12-22 13:36:57.546829"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.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.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1444], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.553119"], ["id", 1444]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1444], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.560738"], ["updated_at", "2020-12-22 13:36:57.560738"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:36:57.563290"], ["updated_at", "2020-12-22 13:36:57.563290"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1446], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.566031"], ["id", 1446]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1446], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:36:57.571103"], ["updated_at", "2020-12-22 13:36:57.571103"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:36:57.591411"], ["updated_at", "2020-12-22 13:36:57.591411"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:36:57.596016"], ["updated_at", "2020-12-22 13:36:57.596016"], ["synced_id", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:36:57.601077"], ["updated_at", "2020-12-22 13:36:57.601077"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.604410"], ["updated_at", "2020-12-22 13:36:57.604410"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.608436"], ["updated_at", "2020-12-22 13:36:57.608436"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608557817"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1452], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:36:57.627171"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1452]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:36:57.630897"], ["updated_at", "2020-12-22 13:36:57.630897"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608730617"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:36:57.635290"], ["updated_at", "2020-12-22 13:36:57.635290"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:36:57.637360"], ["updated_at", "2020-12-22 13:36:57.637360"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:36:57.639211"], ["updated_at", "2020-12-22 13:36:57.639211"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.645802"], ["updated_at", "2020-12-22 13:36:57.645802"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.652329"], ["updated_at", "2020-12-22 13:36:57.652329"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.663788"], ["updated_at", "2020-12-22 13:36:57.663788"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (2.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.682765"], ["updated_at", "2020-12-22 13:36:57.682765"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.701549"], ["updated_at", "2020-12-22 13:36:57.701549"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.709829"], ["updated_at", "2020-12-22 13:36:57.709829"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:36:57.722898"], ["updated_at", "2020-12-22 13:36:57.722898"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (2.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:46:06.089723"], ["updated_at", "2020-12-22 13:46:06.089723"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:46:06.099188"], ["updated_at", "2020-12-22 13:46:06.099188"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:46:06.101014"], ["updated_at", "2020-12-22 13:46:06.101014"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:46:06.392753"], ["updated_at", "2020-12-22 13:46:06.392753"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:46:06.395001"], ["synced_id", 0], ["id", 1460]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (2.5ms) BEGIN  (0.1ms) 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]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:46:06.430904"], ["updated_at", "2020-12-22 13:46:06.430904"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.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", "2020-12-22 13:46:06.451439"], ["updated_at", "2020-12-22 13:46:06.451439"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558366"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1462], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:46:06.495579"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1462]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:06.500055"], ["updated_at", "2020-12-22 13:46:06.500055"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731166"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:06.505624"], ["updated_at", "2020-12-22 13:46:06.505624"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1464], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1464], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:06.521803"], ["id", 1464]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1464], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:06.529349"], ["updated_at", "2020-12-22 13:46:06.529349"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.571398"], ["updated_at", "2020-12-22 13:46:06.571398"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:06.576732"], ["updated_at", "2020-12-22 13:46:06.576732"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.602549"], ["updated_at", "2020-12-22 13:46:06.602549"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 13:46:06.607031"], ["updated_at", "2020-12-22 13:46:06.607031"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.611028"], ["updated_at", "2020-12-22 13:46:06.611028"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:06.615323"], ["updated_at", "2020-12-22 13:46:06.615323"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.619011"], ["updated_at", "2020-12-22 13:46:06.619011"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:06.622153"], ["updated_at", "2020-12-22 13:46:06.622153"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) 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]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.631837"], ["updated_at", "2020-12-22 13:46:06.631837"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.634401"], ["updated_at", "2020-12-22 13:46:06.634401"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1475], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:06.637939"], ["id", 1475]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.642143"], ["updated_at", "2020-12-22 13:46:06.642143"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.644506"], ["updated_at", "2020-12-22 13:46:06.644506"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1477], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:06.647285"], ["id", 1477]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1477], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.651149"], ["updated_at", "2020-12-22 13:46:06.651149"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.654297"], ["updated_at", "2020-12-22 13:46:06.654297"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1479], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:06.656915"], ["id", 1479]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1479], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.661067"], ["updated_at", "2020-12-22 13:46:06.661067"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.662894"], ["updated_at", "2020-12-22 13:46:06.662894"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1481], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:06.665703"], ["id", 1481]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:46:06.669759"], ["updated_at", "2020-12-22 13:46:06.669759"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:46:06.672875"], ["updated_at", "2020-12-22 13:46:06.672875"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:46:06.690245"], ["updated_at", "2020-12-22 13:46:06.690245"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:46:06.718794"], ["updated_at", "2020-12-22 13:46:06.718794"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 11ms (Views: 10.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 5ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.786871"], ["updated_at", "2020-12-22 13:46:06.786871"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.796599"], ["updated_at", "2020-12-22 13:46:06.796599"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.811346"], ["updated_at", "2020-12-22 13:46:06.811346"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.825760"], ["updated_at", "2020-12-22 13:46:06.825760"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.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 (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.842781"], ["updated_at", "2020-12-22 13:46:06.842781"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.854042"], ["updated_at", "2020-12-22 13:46:06.854042"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.867625"], ["updated_at", "2020-12-22 13:46:06.867625"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) 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]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.878425"], ["updated_at", "2020-12-22 13:46:06.878425"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", 1], ["host", "example.test"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.898425"], ["updated_at", "2020-12-22 13:46:06.898425"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.901840"], ["updated_at", "2020-12-22 13:46:06.901840"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.904304"], ["updated_at", "2020-12-22 13:46:06.904304"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.906931"], ["updated_at", "2020-12-22 13:46:06.906931"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:46:06.913296"], ["updated_at", "2020-12-22 13:46:06.913296"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558366"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.916889"], ["updated_at", "2020-12-22 13:46:06.916889"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1413], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:46:06.940899"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1413]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:46:06.947995"], ["updated_at", "2020-12-22 13:46:06.947995"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731166"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.953543"], ["updated_at", "2020-12-22 13:46:06.953543"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:06.958469"], ["updated_at", "2020-12-22 13:46:06.958469"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.963424"], ["updated_at", "2020-12-22 13:46:06.963424"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:46:06.986583"], ["updated_at", "2020-12-22 13:46:06.986583"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:06.993138"], ["updated_at", "2020-12-22 13:46:06.993138"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.006933"], ["updated_at", "2020-12-22 13:46:07.006933"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.009884"], ["updated_at", "2020-12-22 13:46:07.009884"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:46:07.013411"], ["updated_at", "2020-12-22 13:46:07.013411"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:46:07.018800"], ["updated_at", "2020-12-22 13:46:07.018800"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.021071"], ["updated_at", "2020-12-22 13:46:07.021071"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:46:07.025682"], ["updated_at", "2020-12-22 13:46:07.025682"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.027780"], ["updated_at", "2020-12-22 13:46:07.027780"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:46:07.031642"], ["updated_at", "2020-12-22 13:46:07.031642"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:46:07.033975"], ["updated_at", "2020-12-22 13:46:07.033975"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.038380"], ["updated_at", "2020-12-22 13:46:07.038380"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.040695"], ["updated_at", "2020-12-22 13:46:07.040695"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1427], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:07.043842"], ["id", 1427]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.047623"], ["updated_at", "2020-12-22 13:46:07.047623"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.049832"], ["updated_at", "2020-12-22 13:46:07.049832"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1429], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:07.053273"], ["id", 1429]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1429], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.057438"], ["updated_at", "2020-12-22 13:46:07.057438"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.059836"], ["updated_at", "2020-12-22 13:46:07.059836"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1431], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:07.062559"], ["id", 1431]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1431], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.066543"], ["updated_at", "2020-12-22 13:46:07.066543"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.069908"], ["updated_at", "2020-12-22 13:46:07.069908"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:07.074668"], ["updated_at", "2020-12-22 13:46:07.074668"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.079040"], ["updated_at", "2020-12-22 13:46:07.079040"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:46:07.083498"], ["updated_at", "2020-12-22 13:46:07.083498"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1436], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1436], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:07.087430"], ["id", 1436]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1436], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:07.091717"], ["updated_at", "2020-12-22 13:46:07.091717"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.095096"], ["updated_at", "2020-12-22 13:46:07.095096"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:46:07.098668"], ["updated_at", "2020-12-22 13:46:07.098668"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:07.120944"], ["updated_at", "2020-12-22 13:46:07.120944"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:07.132664"], ["updated_at", "2020-12-22 13:46:07.132664"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:46:07.141781"], ["updated_at", "2020-12-22 13:46:07.141781"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:46:07.152376"], ["updated_at", "2020-12-22 13:46:07.152376"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:07.177429"], ["updated_at", "2020-12-22 13:46:07.177429"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:46:07.180129"], ["updated_at", "2020-12-22 13:46:07.180129"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:46:07.185328"], ["updated_at", "2020-12-22 13:46:07.185328"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (1.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (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", "2020-12-22 13:48:11.774275"], ["updated_at", "2020-12-22 13:48:11.774275"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.054673"], ["updated_at", "2020-12-22 13:48:12.054673"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.057310"], ["updated_at", "2020-12-22 13:48:12.057310"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1492], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.068759"], ["id", 1492]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.077756"], ["updated_at", "2020-12-22 13:48:12.077756"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.079645"], ["updated_at", "2020-12-22 13:48:12.079645"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1494], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.084119"], ["id", 1494]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1494], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.093323"], ["updated_at", "2020-12-22 13:48:12.093323"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.096421"], ["updated_at", "2020-12-22 13:48:12.096421"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1496], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.099915"], ["id", 1496]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1496], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.107773"], ["updated_at", "2020-12-22 13:48:12.107773"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.110003"], ["updated_at", "2020-12-22 13:48:12.110003"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1498], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.113521"], ["id", 1498]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.116800"], ["updated_at", "2020-12-22 13:48:12.116800"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 13:48:12.122893"], ["updated_at", "2020-12-22 13:48:12.122893"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.127930"], ["updated_at", "2020-12-22 13:48:12.127930"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.131923"], ["updated_at", "2020-12-22 13:48:12.131923"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.135322"], ["updated_at", "2020-12-22 13:48:12.135322"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.151806"], ["updated_at", "2020-12-22 13:48:12.151806"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.155642"], ["updated_at", "2020-12-22 13:48:12.155642"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.158802"], ["updated_at", "2020-12-22 13:48:12.158802"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.170862"], ["updated_at", "2020-12-22 13:48:12.170862"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731292"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.177836"], ["updated_at", "2020-12-22 13:48:12.177836"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558492"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1508], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:48:12.216813"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1508]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:12.220677"], ["updated_at", "2020-12-22 13:48:12.220677"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:12.259073"], ["updated_at", "2020-12-22 13:48:12.259073"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:12.261007"], ["updated_at", "2020-12-22 13:48:12.261007"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:12.262698"], ["updated_at", "2020-12-22 13:48:12.262698"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:48:12.277395"], ["updated_at", "2020-12-22 13:48:12.277395"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:48:12.279002"], ["synced_id", 0], ["id", 1513]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:12.292311"], ["updated_at", "2020-12-22 13:48:12.292311"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:12.296609"], ["updated_at", "2020-12-22 13:48:12.296609"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:12.317434"], ["updated_at", "2020-12-22 13:48:12.317434"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:12.363437"], ["updated_at", "2020-12-22 13:48:12.363437"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.383572"], ["updated_at", "2020-12-22 13:48:12.383572"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1518], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1518], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.389520"], ["id", 1518]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1518], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.407680"], ["updated_at", "2020-12-22 13:48:12.407680"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 13ms (ActiveRecord: 0.8ms)  (1.0ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.427384"], ["updated_at", "2020-12-22 13:48:12.427384"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.438482"], ["updated_at", "2020-12-22 13:48:12.438482"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (2.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:48:12.484466"], ["updated_at", "2020-12-22 13:48:12.484466"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 35ms (ActiveRecord: 2.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 14ms (Views: 10.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) 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 (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.531503"], ["updated_at", "2020-12-22 13:48:12.531503"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.542217"], ["updated_at", "2020-12-22 13:48:12.542217"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.553875"], ["updated_at", "2020-12-22 13:48:12.553875"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.561624"], ["updated_at", "2020-12-22 13:48:12.561624"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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 (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.579838"], ["updated_at", "2020-12-22 13:48:12.579838"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) 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.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 (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.595976"], ["updated_at", "2020-12-22 13:48:12.595976"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:12.607491"], ["updated_at", "2020-12-22 13:48:12.607491"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.612364"], ["updated_at", "2020-12-22 13:48:12.612364"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one 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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.614802"], ["updated_at", "2020-12-22 13:48:12.614802"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.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 4ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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.7ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.648611"], ["updated_at", "2020-12-22 13:48:12.648611"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:12.662018"], ["updated_at", "2020-12-22 13:48:12.662018"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731292"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.665429"], ["updated_at", "2020-12-22 13:48:12.665429"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:12.669375"], ["updated_at", "2020-12-22 13:48:12.669375"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558492"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.673219"], ["updated_at", "2020-12-22 13:48:12.673219"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1445], ["host", "example.test"], ["LIMIT", 1]] SQL (0.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:48:12.690154"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1445]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.695138"], ["updated_at", "2020-12-22 13:48:12.695138"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.698816"], ["updated_at", "2020-12-22 13:48:12.698816"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.701859"], ["updated_at", "2020-12-22 13:48:12.701859"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:12.706848"], ["updated_at", "2020-12-22 13:48:12.706848"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.711545"], ["updated_at", "2020-12-22 13:48:12.711545"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.714597"], ["updated_at", "2020-12-22 13:48:12.714597"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.733955"], ["updated_at", "2020-12-22 13:48:12.733955"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.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 (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.747196"], ["updated_at", "2020-12-22 13:48:12.747196"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.751543"], ["updated_at", "2020-12-22 13:48:12.751543"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.755917"], ["updated_at", "2020-12-22 13:48:12.755917"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:12.759898"], ["updated_at", "2020-12-22 13:48:12.759898"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1451], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1451], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.763331"], ["id", 1451]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1451], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.767938"], ["updated_at", "2020-12-22 13:48:12.767938"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.770908"], ["updated_at", "2020-12-22 13:48:12.770908"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.773954"], ["updated_at", "2020-12-22 13:48:12.773954"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:12.776235"], ["updated_at", "2020-12-22 13:48:12.776235"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.780888"], ["updated_at", "2020-12-22 13:48:12.780888"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.782957"], ["updated_at", "2020-12-22 13:48:12.782957"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:12.787163"], ["updated_at", "2020-12-22 13:48:12.787163"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:12.793669"], ["updated_at", "2020-12-22 13:48:12.793669"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.796067"], ["updated_at", "2020-12-22 13:48:12.796067"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:12.800248"], ["updated_at", "2020-12-22 13:48:12.800248"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.803143"], ["updated_at", "2020-12-22 13:48:12.803143"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:12.808820"], ["updated_at", "2020-12-22 13:48:12.808820"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.811121"], ["updated_at", "2020-12-22 13:48:12.811121"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.814454"], ["updated_at", "2020-12-22 13:48:12.814454"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.816820"], ["updated_at", "2020-12-22 13:48:12.816820"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1465], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.820513"], ["id", 1465]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.824717"], ["updated_at", "2020-12-22 13:48:12.824717"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.826805"], ["updated_at", "2020-12-22 13:48:12.826805"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1467], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.829792"], ["id", 1467]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1467], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.834335"], ["updated_at", "2020-12-22 13:48:12.834335"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.837377"], ["updated_at", "2020-12-22 13:48:12.837377"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1469], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:12.841884"], ["id", 1469]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1469], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.846646"], ["updated_at", "2020-12-22 13:48:12.846646"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:12.848527"], ["updated_at", "2020-12-22 13:48:12.848527"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (5.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]] SQL (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", "2020-12-22 13:48:36.634720"], ["updated_at", "2020-12-22 13:48:36.634720"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:36.860061"], ["updated_at", "2020-12-22 13:48:36.860061"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558516"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (4.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:36.874878"], ["updated_at", "2020-12-22 13:48:36.874878"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1474], ["host", "example.test"], ["LIMIT", 1]] SQL (0.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:48:36.908915"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1474]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:36.916193"], ["updated_at", "2020-12-22 13:48:36.916193"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731316"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:36.919498"], ["updated_at", "2020-12-22 13:48:36.919498"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:36.923471"], ["updated_at", "2020-12-22 13:48:36.923471"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:36.925861"], ["updated_at", "2020-12-22 13:48:36.925861"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:36.928396"], ["updated_at", "2020-12-22 13:48:36.928396"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:36.930359"], ["updated_at", "2020-12-22 13:48:36.930359"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:36.934986"], ["updated_at", "2020-12-22 13:48:36.934986"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1480], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1480], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:36.945168"], ["id", 1480]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1480], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:36.950156"], ["updated_at", "2020-12-22 13:48:36.950156"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:36.954229"], ["updated_at", "2020-12-22 13:48:36.954229"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:36.957411"], ["updated_at", "2020-12-22 13:48:36.957411"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) 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]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:36.961208"], ["updated_at", "2020-12-22 13:48:36.961208"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:36.965271"], ["updated_at", "2020-12-22 13:48:36.965271"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:36.968467"], ["updated_at", "2020-12-22 13:48:36.968467"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:36.972241"], ["updated_at", "2020-12-22 13:48:36.972241"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) 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]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:36.976610"], ["updated_at", "2020-12-22 13:48:36.976610"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:36.995150"], ["updated_at", "2020-12-22 13:48:36.995150"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:36.997362"], ["updated_at", "2020-12-22 13:48:36.997362"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:48:37.003858"], ["updated_at", "2020-12-22 13:48:37.003858"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.006648"], ["updated_at", "2020-12-22 13:48:37.006648"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:37.011725"], ["updated_at", "2020-12-22 13:48:37.011725"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:37.018549"], ["updated_at", "2020-12-22 13:48:37.018549"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.020988"], ["updated_at", "2020-12-22 13:48:37.020988"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:48:37.026253"], ["updated_at", "2020-12-22 13:48:37.026253"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.029394"], ["updated_at", "2020-12-22 13:48:37.029394"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:37.039293"], ["updated_at", "2020-12-22 13:48:37.039293"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.043629"], ["updated_at", "2020-12-22 13:48:37.043629"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.050467"], ["updated_at", "2020-12-22 13:48:37.050467"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.053453"], ["updated_at", "2020-12-22 13:48:37.053453"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1496], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.057403"], ["id", 1496]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.062697"], ["updated_at", "2020-12-22 13:48:37.062697"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.065710"], ["updated_at", "2020-12-22 13:48:37.065710"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1498], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.069130"], ["id", 1498]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1498], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.073442"], ["updated_at", "2020-12-22 13:48:37.073442"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.076439"], ["updated_at", "2020-12-22 13:48:37.076439"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1500], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.080401"], ["id", 1500]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1500], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.086745"], ["updated_at", "2020-12-22 13:48:37.086745"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN 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]]  (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]] SQL (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", "2020-12-22 13:48:37.159148"], ["updated_at", "2020-12-22 13:48:37.159148"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 29ms (ActiveRecord: 7.4ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.172101"], ["updated_at", "2020-12-22 13:48:37.172101"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.182440"], ["updated_at", "2020-12-22 13:48:37.182440"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:48:37.191015"], ["updated_at", "2020-12-22 13:48:37.191015"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 14ms (Views: 12.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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: 2.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 23ms (Views: 0.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.280611"], ["updated_at", "2020-12-22 13:48:37.280611"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.292652"], ["updated_at", "2020-12-22 13:48:37.292652"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.306016"], ["updated_at", "2020-12-22 13:48:37.306016"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.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]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.316818"], ["updated_at", "2020-12-22 13:48:37.316818"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) 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]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.325074"], ["updated_at", "2020-12-22 13:48:37.325074"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.335511"], ["updated_at", "2020-12-22 13:48:37.335511"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:48:37.348086"], ["updated_at", "2020-12-22 13:48:37.348086"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:37.361521"], ["updated_at", "2020-12-22 13:48:37.361521"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:37.363749"], ["updated_at", "2020-12-22 13:48:37.363749"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:37.366363"], ["updated_at", "2020-12-22 13:48:37.366363"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.371621"], ["updated_at", "2020-12-22 13:48:37.371621"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1529], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1529], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.374681"], ["id", 1529]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1529], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:37.378976"], ["updated_at", "2020-12-22 13:48:37.378976"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:37.398750"], ["updated_at", "2020-12-22 13:48:37.398750"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:37.403007"], ["updated_at", "2020-12-22 13:48:37.403007"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.407205"], ["updated_at", "2020-12-22 13:48:37.407205"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:37.410631"], ["updated_at", "2020-12-22 13:48:37.410631"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:48:37.421498"], ["updated_at", "2020-12-22 13:48:37.421498"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:48:37.423371"], ["synced_id", 0], ["id", 1535]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:48:37.434848"], ["updated_at", "2020-12-22 13:48:37.434848"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558517"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1536], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:48:37.453203"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1536]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.457599"], ["updated_at", "2020-12-22 13:48:37.457599"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731317"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.462426"], ["updated_at", "2020-12-22 13:48:37.462426"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:48:37.467356"], ["updated_at", "2020-12-22 13:48:37.467356"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.471406"], ["updated_at", "2020-12-22 13:48:37.471406"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.474427"], ["updated_at", "2020-12-22 13:48:37.474427"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.478356"], ["updated_at", "2020-12-22 13:48:37.478356"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.482517"], ["updated_at", "2020-12-22 13:48:37.482517"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.485629"], ["updated_at", "2020-12-22 13:48:37.485629"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.488872"], ["updated_at", "2020-12-22 13:48:37.488872"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.492803"], ["updated_at", "2020-12-22 13:48:37.492803"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.494875"], ["updated_at", "2020-12-22 13:48:37.494875"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1547], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.500066"], ["id", 1547]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1547], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.504058"], ["updated_at", "2020-12-22 13:48:37.504058"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.505840"], ["updated_at", "2020-12-22 13:48:37.505840"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1549], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.508784"], ["id", 1549]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1549], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.512939"], ["updated_at", "2020-12-22 13:48:37.512939"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.515711"], ["updated_at", "2020-12-22 13:48:37.515711"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1551], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.518809"], ["id", 1551]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.522685"], ["updated_at", "2020-12-22 13:48:37.522685"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.524801"], ["updated_at", "2020-12-22 13:48:37.524801"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1553], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:48:37.527830"], ["id", 1553]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:37.531825"], ["updated_at", "2020-12-22 13:48:37.531825"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:48:37.536743"], ["updated_at", "2020-12-22 13:48:37.536743"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.541456"], ["updated_at", "2020-12-22 13:48:37.541456"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:48:37.543538"], ["updated_at", "2020-12-22 13:48:37.543538"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (3.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:26.326157"], ["updated_at", "2020-12-22 13:49:26.326157"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:26.632173"], ["updated_at", "2020-12-22 13:49:26.632173"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:26.665340"], ["updated_at", "2020-12-22 13:49:26.665340"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:26.698601"], ["updated_at", "2020-12-22 13:49:26.698601"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:26.720590"], ["updated_at", "2020-12-22 13:49:26.720590"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:26.734474"], ["updated_at", "2020-12-22 13:49:26.734474"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:26.764805"], ["updated_at", "2020-12-22 13:49:26.764805"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.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 11ms (Views: 10.3ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.4ms) ROLLBACK  (0.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 3ms (Views: 2.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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 5ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:26.860130"], ["updated_at", "2020-12-22 13:49:26.860130"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.host"], ["LIMIT", 1]] SQL (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:26.881622"], ["updated_at", "2020-12-22 13:49:26.881622"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:26.887074"], ["updated_at", "2020-12-22 13:49:26.887074"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 13:49:26.910520"], ["updated_at", "2020-12-22 13:49:26.910520"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:26.917576"], ["updated_at", "2020-12-22 13:49:26.917576"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:26.931838"], ["updated_at", "2020-12-22 13:49:26.931838"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:26.942115"], ["updated_at", "2020-12-22 13:49:26.942115"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 2.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:26.976998"], ["updated_at", "2020-12-22 13:49:26.976998"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1560], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1560], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:26.984060"], ["id", 1560]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1560], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:26.989472"], ["updated_at", "2020-12-22 13:49:26.989472"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:49:26.998642"], ["updated_at", "2020-12-22 13:49:26.998642"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:49:27.000120"], ["synced_id", 0], ["id", 1562]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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]] SQL (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", "2020-12-22 13:49:27.008869"], ["updated_at", "2020-12-22 13:49:27.008869"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731367"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:49:27.014476"], ["updated_at", "2020-12-22 13:49:27.014476"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1564], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:49:27.053111"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1564]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.056446"], ["updated_at", "2020-12-22 13:49:27.056446"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.059390"], ["updated_at", "2020-12-22 13:49:27.059390"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.063848"], ["updated_at", "2020-12-22 13:49:27.063848"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.066292"], ["updated_at", "2020-12-22 13:49:27.066292"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.070218"], ["updated_at", "2020-12-22 13:49:27.070218"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.073140"], ["updated_at", "2020-12-22 13:49:27.073140"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.076257"], ["updated_at", "2020-12-22 13:49:27.076257"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:49:27.079585"], ["updated_at", "2020-12-22 13:49:27.079585"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.083047"], ["updated_at", "2020-12-22 13:49:27.083047"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.085482"], ["updated_at", "2020-12-22 13:49:27.085482"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1574], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.088638"], ["id", 1574]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1574], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.092737"], ["updated_at", "2020-12-22 13:49:27.092737"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.094809"], ["updated_at", "2020-12-22 13:49:27.094809"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1576], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.098127"], ["id", 1576]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1576], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.102470"], ["updated_at", "2020-12-22 13:49:27.102470"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.104824"], ["updated_at", "2020-12-22 13:49:27.104824"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1578], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.107542"], ["id", 1578]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.111351"], ["updated_at", "2020-12-22 13:49:27.111351"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.114075"], ["updated_at", "2020-12-22 13:49:27.114075"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1580], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.117494"], ["id", 1580]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:27.121812"], ["updated_at", "2020-12-22 13:49:27.121812"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.124824"], ["updated_at", "2020-12-22 13:49:27.124824"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:27.128351"], ["updated_at", "2020-12-22 13:49:27.128351"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:27.148236"], ["updated_at", "2020-12-22 13:49:27.148236"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:27.153232"], ["updated_at", "2020-12-22 13:49:27.153232"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:27.158295"], ["updated_at", "2020-12-22 13:49:27.158295"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:27.160936"], ["updated_at", "2020-12-22 13:49:27.160936"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:27.163868"], ["updated_at", "2020-12-22 13:49:27.163868"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.209538"], ["updated_at", "2020-12-22 13:49:27.209538"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.214927"], ["updated_at", "2020-12-22 13:49:27.214927"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.219973"], ["updated_at", "2020-12-22 13:49:27.219973"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.225596"], ["updated_at", "2020-12-22 13:49:27.225596"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) 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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.238486"], ["updated_at", "2020-12-22 13:49:27.238486"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.240768"], ["updated_at", "2020-12-22 13:49:27.240768"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:27.245010"], ["updated_at", "2020-12-22 13:49:27.245010"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:27.250394"], ["updated_at", "2020-12-22 13:49:27.250394"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.252607"], ["updated_at", "2020-12-22 13:49:27.252607"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:27.257395"], ["updated_at", "2020-12-22 13:49:27.257395"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.260065"], ["updated_at", "2020-12-22 13:49:27.260065"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.3ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:27.264994"], ["updated_at", "2020-12-22 13:49:27.264994"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.267197"], ["updated_at", "2020-12-22 13:49:27.267197"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.270753"], ["updated_at", "2020-12-22 13:49:27.270753"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.273408"], ["updated_at", "2020-12-22 13:49:27.273408"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1519], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 13:49:27.278142"], ["id", 1519]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.285294"], ["updated_at", "2020-12-22 13:49:27.285294"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.289745"], ["updated_at", "2020-12-22 13:49:27.289745"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.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"."id" != $2) AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1521], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.295820"], ["id", 1521]]  (0.2ms) 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", 1521], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.302944"], ["updated_at", "2020-12-22 13:49:27.302944"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.306261"], ["updated_at", "2020-12-22 13:49:27.306261"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1523], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.309478"], ["id", 1523]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1523], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:49:27.314626"], ["updated_at", "2020-12-22 13:49:27.314626"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.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", 456], ["host", "example2.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 13:49:27.319886"], ["updated_at", "2020-12-22 13:49:27.319886"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.325469"], ["updated_at", "2020-12-22 13:49:27.325469"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.328197"], ["updated_at", "2020-12-22 13:49:27.328197"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.331059"], ["updated_at", "2020-12-22 13:49:27.331059"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.333899"], ["updated_at", "2020-12-22 13:49:27.333899"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:27.337558"], ["updated_at", "2020-12-22 13:49:27.337558"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1531], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1531], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.341172"], ["id", 1531]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1531], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:27.346618"], ["updated_at", "2020-12-22 13:49:27.346618"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558567"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (3.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.349821"], ["updated_at", "2020-12-22 13:49:27.349821"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1532], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:27.372984"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1532]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:27.376773"], ["updated_at", "2020-12-22 13:49:27.376773"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731367"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.380781"], ["updated_at", "2020-12-22 13:49:27.380781"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.384982"], ["updated_at", "2020-12-22 13:49:27.384982"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.388939"], ["updated_at", "2020-12-22 13:49:27.388939"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.396779"], ["updated_at", "2020-12-22 13:49:27.396779"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:27.401891"], ["updated_at", "2020-12-22 13:49:27.401891"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:27.405493"], ["updated_at", "2020-12-22 13:49:27.405493"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:27.409676"], ["updated_at", "2020-12-22 13:49:27.409676"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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]] SQL (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", "2020-12-22 13:49:54.687624"], ["updated_at", "2020-12-22 13:49:54.687624"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558594"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1589], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:49:54.732087"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1589]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:54.937421"], ["updated_at", "2020-12-22 13:49:54.937421"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731394"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:49:54.948531"], ["updated_at", "2020-12-22 13:49:54.948531"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:49:54.950144"], ["synced_id", 0], ["id", 1591]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:54.962149"], ["updated_at", "2020-12-22 13:49:54.962149"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:54.983690"], ["updated_at", "2020-12-22 13:49:54.983690"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:55.015314"], ["updated_at", "2020-12-22 13:49:55.015314"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:55.081846"], ["updated_at", "2020-12-22 13:49:55.081846"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:55.085048"], ["updated_at", "2020-12-22 13:49:55.085048"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.088700"], ["updated_at", "2020-12-22 13:49:55.088700"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.091385"], ["updated_at", "2020-12-22 13:49:55.091385"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1598], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.097806"], ["id", 1598]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.102760"], ["updated_at", "2020-12-22 13:49:55.102760"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.106884"], ["updated_at", "2020-12-22 13:49:55.106884"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1600], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.110576"], ["id", 1600]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1600], ["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.116808"], ["updated_at", "2020-12-22 13:49:55.116808"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.119085"], ["updated_at", "2020-12-22 13:49:55.119085"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 1602], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.123293"], ["id", 1602]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1602], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.129586"], ["updated_at", "2020-12-22 13:49:55.129586"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.132154"], ["updated_at", "2020-12-22 13:49:55.132154"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1604], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.135334"], ["id", 1604]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.139438"], ["updated_at", "2020-12-22 13:49:55.139438"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.146866"], ["updated_at", "2020-12-22 13:49:55.146866"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.150347"], ["updated_at", "2020-12-22 13:49:55.150347"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.153511"], ["updated_at", "2020-12-22 13:49:55.153511"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.158431"], ["updated_at", "2020-12-22 13:49:55.158431"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.163604"], ["updated_at", "2020-12-22 13:49:55.163604"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.168734"], ["updated_at", "2020-12-22 13:49:55.168734"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 13:49:55.175541"], ["updated_at", "2020-12-22 13:49:55.175541"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.181421"], ["updated_at", "2020-12-22 13:49:55.181421"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1613], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1613], ["LIMIT", 1]] SQL (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", "2020-12-22 13:49:55.192765"], ["id", 1613]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1613], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:55.200382"], ["updated_at", "2020-12-22 13:49:55.200382"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:55.205960"], ["updated_at", "2020-12-22 13:49:55.205960"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:55.211343"], ["updated_at", "2020-12-22 13:49:55.211343"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.224159"], ["updated_at", "2020-12-22 13:49:55.224159"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (4.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (1.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.252697"], ["updated_at", "2020-12-22 13:49:55.252697"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.273775"], ["updated_at", "2020-12-22 13:49:55.273775"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (1.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.297919"], ["updated_at", "2020-12-22 13:49:55.297919"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.332031"], ["updated_at", "2020-12-22 13:49:55.332031"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (6.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.351844"], ["updated_at", "2020-12-22 13:49:55.351844"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.360552"], ["updated_at", "2020-12-22 13:49:55.360552"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.369036"], ["updated_at", "2020-12-22 13:49:55.369036"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 13:49:55.402418"], ["updated_at", "2020-12-22 13:49:55.402418"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1537], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1537], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.407801"], ["id", 1537]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1537], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.412253"], ["updated_at", "2020-12-22 13:49:55.412253"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.415398"], ["updated_at", "2020-12-22 13:49:55.415398"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.434270"], ["updated_at", "2020-12-22 13:49:55.434270"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.436316"], ["updated_at", "2020-12-22 13:49:55.436316"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.440794"], ["updated_at", "2020-12-22 13:49:55.440794"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.443096"], ["updated_at", "2020-12-22 13:49:55.443096"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1541], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.446953"], ["id", 1541]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.450424"], ["updated_at", "2020-12-22 13:49:55.450424"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.452286"], ["updated_at", "2020-12-22 13:49:55.452286"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1543], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.456220"], ["id", 1543]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1543], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.461372"], ["updated_at", "2020-12-22 13:49:55.461372"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.463592"], ["updated_at", "2020-12-22 13:49:55.463592"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1545], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.466682"], ["id", 1545]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1545], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:49:55.470997"], ["updated_at", "2020-12-22 13:49:55.470997"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.474068"], ["updated_at", "2020-12-22 13:49:55.474068"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:55.477968"], ["updated_at", "2020-12-22 13:49:55.477968"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:55.482449"], ["updated_at", "2020-12-22 13:49:55.482449"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.484687"], ["updated_at", "2020-12-22 13:49:55.484687"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) 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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:55.489904"], ["updated_at", "2020-12-22 13:49:55.489904"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:49:55.492243"], ["updated_at", "2020-12-22 13:49:55.492243"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.4ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:55.497711"], ["updated_at", "2020-12-22 13:49:55.497711"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.500166"], ["updated_at", "2020-12-22 13:49:55.500166"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:55.506950"], ["updated_at", "2020-12-22 13:49:55.506950"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558595"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.515784"], ["updated_at", "2020-12-22 13:49:55.515784"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1556], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:49:55.539115"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1556]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:55.543240"], ["updated_at", "2020-12-22 13:49:55.543240"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731395"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.547319"], ["updated_at", "2020-12-22 13:49:55.547319"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.551874"], ["updated_at", "2020-12-22 13:49:55.551874"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.559480"], ["updated_at", "2020-12-22 13:49:55.559480"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.564172"], ["updated_at", "2020-12-22 13:49:55.564172"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.568966"], ["updated_at", "2020-12-22 13:49:55.568966"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.579482"], ["updated_at", "2020-12-22 13:49:55.579482"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.582590"], ["updated_at", "2020-12-22 13:49:55.582590"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:49:55.587752"], ["updated_at", "2020-12-22 13:49:55.587752"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.593301"], ["updated_at", "2020-12-22 13:49:55.593301"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.596288"], ["updated_at", "2020-12-22 13:49:55.596288"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.598733"], ["updated_at", "2020-12-22 13:49:55.598733"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.601015"], ["updated_at", "2020-12-22 13:49:55.601015"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:55.606155"], ["updated_at", "2020-12-22 13:49:55.606155"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.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 10ms (Views: 9.7ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.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 6ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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 4ms (Views: 3.6ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.662054"], ["updated_at", "2020-12-22 13:49:55.662054"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:49:55.664421"], ["updated_at", "2020-12-22 13:49:55.664421"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:49:55.668994"], ["updated_at", "2020-12-22 13:49:55.668994"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.679596"], ["updated_at", "2020-12-22 13:49:55.679596"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.686314"], ["updated_at", "2020-12-22 13:49:55.686314"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:49:55.697058"], ["updated_at", "2020-12-22 13:49:55.697058"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:49:55.707301"], ["updated_at", "2020-12-22 13:49:55.707301"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (3.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:08.827329"], ["updated_at", "2020-12-22 13:50:08.827329"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:08.844693"], ["updated_at", "2020-12-22 13:50:08.844693"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:08.860936"], ["updated_at", "2020-12-22 13:50:08.860936"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:08.870297"], ["updated_at", "2020-12-22 13:50:08.870297"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:08.882955"], ["updated_at", "2020-12-22 13:50:08.882955"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:08.892279"], ["updated_at", "2020-12-22 13:50:08.892279"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.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 10ms (Views: 9.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) 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]]  (0.2ms) 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]] SQL (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", "2020-12-22 13:50:08.990498"], ["updated_at", "2020-12-22 13:50:08.990498"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 20ms (ActiveRecord: 6.3ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:08.997073"], ["updated_at", "2020-12-22 13:50:08.997073"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (3.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:50:09.029049"], ["updated_at", "2020-12-22 13:50:09.029049"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 20ms (ActiveRecord: 3.7ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.039413"], ["updated_at", "2020-12-22 13:50:09.039413"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 4ms (Views: 2.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.072384"], ["updated_at", "2020-12-22 13:50:09.072384"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.091987"], ["updated_at", "2020-12-22 13:50:09.091987"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.094410"], ["updated_at", "2020-12-22 13:50:09.094410"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:09.101865"], ["updated_at", "2020-12-22 13:50:09.101865"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.111964"], ["updated_at", "2020-12-22 13:50:09.111964"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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 (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.118776"], ["updated_at", "2020-12-22 13:50:09.118776"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.121892"], ["updated_at", "2020-12-22 13:50:09.121892"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.126468"], ["updated_at", "2020-12-22 13:50:09.126468"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.129233"], ["updated_at", "2020-12-22 13:50:09.129233"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.131276"], ["updated_at", "2020-12-22 13:50:09.131276"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.135027"], ["updated_at", "2020-12-22 13:50:09.135027"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.139981"], ["updated_at", "2020-12-22 13:50:09.139981"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "test.example"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.153202"], ["updated_at", "2020-12-22 13:50:09.153202"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.157547"], ["updated_at", "2020-12-22 13:50:09.157547"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.163352"], ["updated_at", "2020-12-22 13:50:09.163352"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:50:09.198345"], ["updated_at", "2020-12-22 13:50:09.198345"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1579], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1579], ["host", "example.test"], ["LIMIT", 1]] SQL (1.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", "2020-12-22 13:50:09.206808"], ["id", 1579]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1579], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.213809"], ["updated_at", "2020-12-22 13:50:09.213809"], ["synced_id", 123], ["host", "test.example"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.219544"], ["updated_at", "2020-12-22 13:50:09.219544"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:50:09.247453"], ["updated_at", "2020-12-22 13:50:09.247453"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558609"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.251582"], ["updated_at", "2020-12-22 13:50:09.251582"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1581], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:50:09.268780"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1581]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:50:09.293018"], ["updated_at", "2020-12-22 13:50:09.293018"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731409"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.296041"], ["updated_at", "2020-12-22 13:50:09.296041"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:50:09.299790"], ["updated_at", "2020-12-22 13:50:09.299790"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.303372"], ["updated_at", "2020-12-22 13:50:09.303372"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.305693"], ["updated_at", "2020-12-22 13:50:09.305693"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.308803"], ["updated_at", "2020-12-22 13:50:09.308803"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.310698"], ["updated_at", "2020-12-22 13:50:09.310698"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:50:09.313909"], ["updated_at", "2020-12-22 13:50:09.313909"], ["provider", "bookingsync"], ["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.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:50:09.320204"], ["updated_at", "2020-12-22 13:50:09.320204"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.322272"], ["updated_at", "2020-12-22 13:50:09.322272"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:50:09.326631"], ["updated_at", "2020-12-22 13:50:09.326631"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.328697"], ["updated_at", "2020-12-22 13:50:09.328697"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:50:09.334250"], ["updated_at", "2020-12-22 13:50:09.334250"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.336577"], ["updated_at", "2020-12-22 13:50:09.336577"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.339697"], ["updated_at", "2020-12-22 13:50:09.339697"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.341632"], ["updated_at", "2020-12-22 13:50:09.341632"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1595], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.344648"], ["id", 1595]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:50:09.348023"], ["updated_at", "2020-12-22 13:50:09.348023"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.356257"], ["updated_at", "2020-12-22 13:50:09.356257"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1597], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.359834"], ["id", 1597]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1597], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.364216"], ["updated_at", "2020-12-22 13:50:09.364216"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:09.366732"], ["updated_at", "2020-12-22 13:50:09.366732"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1599], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.370270"], ["id", 1599]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1599], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:09.374507"], ["updated_at", "2020-12-22 13:50:09.374507"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:09.376800"], ["updated_at", "2020-12-22 13:50:09.376800"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:09.378860"], ["updated_at", "2020-12-22 13:50:09.378860"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.386903"], ["updated_at", "2020-12-22 13:50:09.386903"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:09.392125"], ["updated_at", "2020-12-22 13:50:09.392125"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:09.410699"], ["updated_at", "2020-12-22 13:50:09.410699"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:09.414910"], ["updated_at", "2020-12-22 13:50:09.414910"], ["synced_id", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:50:09.440571"], ["updated_at", "2020-12-22 13:50:09.440571"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:50:09.442133"], ["synced_id", 0], ["id", 1633]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:09.448376"], ["updated_at", "2020-12-22 13:50:09.448376"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.453032"], ["updated_at", "2020-12-22 13:50:09.453032"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731409"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.456099"], ["updated_at", "2020-12-22 13:50:09.456099"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558609"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1636], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:50:09.472016"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1636]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:09.475500"], ["updated_at", "2020-12-22 13:50:09.475500"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.478515"], ["updated_at", "2020-12-22 13:50:09.478515"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1638], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1638], ["LIMIT", 1]] SQL (0.5ms) 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", "2020-12-22 13:50:09.482005"], ["id", 1638]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1638], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.488646"], ["updated_at", "2020-12-22 13:50:09.488646"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:50:09.492115"], ["updated_at", "2020-12-22 13:50:09.492115"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.496031"], ["updated_at", "2020-12-22 13:50:09.496031"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:50:09.499119"], ["updated_at", "2020-12-22 13:50:09.499119"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.502784"], ["updated_at", "2020-12-22 13:50:09.502784"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.505399"], ["updated_at", "2020-12-22 13:50:09.505399"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.508740"], ["updated_at", "2020-12-22 13:50:09.508740"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.511163"], ["updated_at", "2020-12-22 13:50:09.511163"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.514964"], ["updated_at", "2020-12-22 13:50:09.514964"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.517637"], ["updated_at", "2020-12-22 13:50:09.517637"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1648], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.520410"], ["id", 1648]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.524709"], ["updated_at", "2020-12-22 13:50:09.524709"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.526679"], ["updated_at", "2020-12-22 13:50:09.526679"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1650], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.529336"], ["id", 1650]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1650], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.533932"], ["updated_at", "2020-12-22 13:50:09.533932"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.535998"], ["updated_at", "2020-12-22 13:50:09.535998"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1652], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.538805"], ["id", 1652]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1652], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.542407"], ["updated_at", "2020-12-22 13:50:09.542407"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:09.544386"], ["updated_at", "2020-12-22 13:50:09.544386"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1654], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:50:09.546699"], ["id", 1654]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.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", "2020-12-22 13:50:21.715241"], ["updated_at", "2020-12-22 13:50:21.715241"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) 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.2ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 10ms (Views: 9.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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: 3.0ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 3.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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)  (0.1ms) ROLLBACK  (0.1ms) 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]]  (0.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.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", "2020-12-22 13:50:22.165822"], ["updated_at", "2020-12-22 13:50:22.165822"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 25ms (ActiveRecord: 9.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:22.178319"], ["updated_at", "2020-12-22 13:50:22.178319"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (3.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "2020-12-22 13:50:22.219459"], ["updated_at", "2020-12-22 13:50:22.219459"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 26ms (ActiveRecord: 5.1ms)  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:22.231518"], ["updated_at", "2020-12-22 13:50:22.231518"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.247085"], ["updated_at", "2020-12-22 13:50:22.247085"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.249162"], ["updated_at", "2020-12-22 13:50:22.249162"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1659], ["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", "2020-12-22 13:50:22.252219"], ["id", 1659]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1659], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) 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 (1.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.262054"], ["updated_at", "2020-12-22 13:50:22.262054"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.272022"], ["updated_at", "2020-12-22 13:50:22.272022"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1661], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:50:22.277658"], ["id", 1661]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1661], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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", "2020-12-22 13:50:22.286703"], ["updated_at", "2020-12-22 13:50:22.286703"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.290459"], ["updated_at", "2020-12-22 13:50:22.290459"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1663], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:50:22.293627"], ["id", 1663]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.296931"], ["updated_at", "2020-12-22 13:50:22.296931"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.298957"], ["updated_at", "2020-12-22 13:50:22.298957"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1665], ["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", "2020-12-22 13:50:22.301906"], ["id", 1665]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.307258"], ["updated_at", "2020-12-22 13:50:22.307258"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:22.310547"], ["updated_at", "2020-12-22 13:50:22.310547"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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", "2020-12-22 13:50:22.315618"], ["updated_at", "2020-12-22 13:50:22.315618"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 13:50:22.323357"], ["updated_at", "2020-12-22 13:50:22.323357"], ["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.2ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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", "2020-12-22 13:50:22.330586"], ["updated_at", "2020-12-22 13:50:22.330586"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:22.335290"], ["updated_at", "2020-12-22 13:50:22.335290"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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", "2020-12-22 13:50:22.341407"], ["updated_at", "2020-12-22 13:50:22.341407"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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", "2020-12-22 13:50:22.347698"], ["updated_at", "2020-12-22 13:50:22.347698"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.3ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:22.365841"], ["updated_at", "2020-12-22 13:50:22.365841"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:22.372032"], ["updated_at", "2020-12-22 13:50:22.372032"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:22.375516"], ["updated_at", "2020-12-22 13:50:22.375516"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:22.380394"], ["updated_at", "2020-12-22 13:50:22.380394"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:22.390417"], ["updated_at", "2020-12-22 13:50:22.390417"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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", "2020-12-22 13:50:22.395217"], ["updated_at", "2020-12-22 13:50:22.395217"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558622"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1679], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:50:22.432530"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1679]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:22.436308"], ["updated_at", "2020-12-22 13:50:22.436308"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731422"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:22.439474"], ["updated_at", "2020-12-22 13:50:22.439474"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:22.458674"], ["updated_at", "2020-12-22 13:50:22.458674"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:22.490037"], ["updated_at", "2020-12-22 13:50:22.490037"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:22.495693"], ["updated_at", "2020-12-22 13:50:22.495693"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1684], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1684], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:50:22.499605"], ["id", 1684]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1684], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:22.510202"], ["updated_at", "2020-12-22 13:50:22.510202"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:50:22.517292"], ["updated_at", "2020-12-22 13:50:22.517292"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:50:22.518855"], ["synced_id", 0], ["id", 1686]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:22.574762"], ["updated_at", "2020-12-22 13:50:22.574762"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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.host"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.580128"], ["updated_at", "2020-12-22 13:50:22.580128"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.582489"], ["updated_at", "2020-12-22 13:50:22.582489"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.588914"], ["updated_at", "2020-12-22 13:50:22.588914"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.591062"], ["updated_at", "2020-12-22 13:50:22.591062"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.594651"], ["updated_at", "2020-12-22 13:50:22.594651"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.596610"], ["updated_at", "2020-12-22 13:50:22.596610"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1606], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:50:22.599993"], ["id", 1606]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.604204"], ["updated_at", "2020-12-22 13:50:22.604204"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.607350"], ["updated_at", "2020-12-22 13:50:22.607350"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.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"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1608], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:50:22.612194"], ["id", 1608]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1608], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.618407"], ["updated_at", "2020-12-22 13:50:22.618407"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.621523"], ["updated_at", "2020-12-22 13:50:22.621523"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1610], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:50:22.625599"], ["id", 1610]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1610], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.631443"], ["updated_at", "2020-12-22 13:50:22.631443"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.633744"], ["updated_at", "2020-12-22 13:50:22.633744"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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", "2020-12-22 13:50:22.638613"], ["updated_at", "2020-12-22 13:50:22.638613"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", "2020-12-22 13:50:22.646170"], ["updated_at", "2020-12-22 13:50:22.646170"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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", "2020-12-22 13:50:22.650495"], ["updated_at", "2020-12-22 13:50:22.650495"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:50:22.657810"], ["updated_at", "2020-12-22 13:50:22.657810"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.659981"], ["updated_at", "2020-12-22 13:50:22.659981"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:50:22.666320"], ["updated_at", "2020-12-22 13:50:22.666320"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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", 456], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.670965"], ["updated_at", "2020-12-22 13:50:22.670965"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.678929"], ["updated_at", "2020-12-22 13:50:22.678929"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.683590"], ["updated_at", "2020-12-22 13:50:22.683590"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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", "2020-12-22 13:50:22.712361"], ["updated_at", "2020-12-22 13:50:22.712361"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558622"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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", "2020-12-22 13:50:22.718334"], ["updated_at", "2020-12-22 13:50:22.718334"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) 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.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"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1622], ["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", "2020-12-22 13:50:22.757268"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1622]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (5.0ms) 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.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", "2020-12-22 13:50:22.773383"], ["updated_at", "2020-12-22 13:50:22.773383"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731422"], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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", "2020-12-22 13:50:22.780699"], ["updated_at", "2020-12-22 13:50:22.780699"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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", "2020-12-22 13:50:22.787102"], ["updated_at", "2020-12-22 13:50:22.787102"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1624], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1624], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:50:22.792168"], ["id", 1624]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1624], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.798163"], ["updated_at", "2020-12-22 13:50:22.798163"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) 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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.814042"], ["updated_at", "2020-12-22 13:50:22.814042"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.817920"], ["updated_at", "2020-12-22 13:50:22.817920"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.822516"], ["updated_at", "2020-12-22 13:50:22.822516"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:50:22.828660"], ["updated_at", "2020-12-22 13:50:22.828660"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.834179"], ["updated_at", "2020-12-22 13:50:22.834179"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.882532"], ["updated_at", "2020-12-22 13:50:22.882532"], ["synced_id", 1], ["host", "example.test"]]  (1.8ms) 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", 2], ["host", "example.test"], ["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", "2020-12-22 13:50:22.892545"], ["updated_at", "2020-12-22 13:50:22.892545"], ["synced_id", 2], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (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", 1], ["host", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.902584"], ["updated_at", "2020-12-22 13:50:22.902584"], ["synced_id", 1], ["host", "example2.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.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", 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", "2020-12-22 13:50:22.907251"], ["updated_at", "2020-12-22 13:50:22.907251"], ["synced_id", 2], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (9.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.5ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:22.924416"], ["updated_at", "2020-12-22 13:50:22.924416"], ["synced_id", 123], ["host", "test.example"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) 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", "2020-12-22 13:50:22.929445"], ["updated_at", "2020-12-22 13:50:22.929445"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.4ms) 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.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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", "2020-12-22 13:50:22.939720"], ["updated_at", "2020-12-22 13:50:22.939720"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.954156"], ["updated_at", "2020-12-22 13:50:22.954156"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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", "2020-12-22 13:50:22.964028"], ["updated_at", "2020-12-22 13:50:22.964028"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.981682"], ["updated_at", "2020-12-22 13:50:22.981682"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:22.990395"], ["updated_at", "2020-12-22 13:50:22.990395"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:23.003224"], ["updated_at", "2020-12-22 13:50:23.003224"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) 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.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (4.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.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", "2020-12-22 13:50:55.885450"], ["updated_at", "2020-12-22 13:50:55.885450"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1633], ["LIMIT", 1]]  (0.1ms) 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", 1633], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:50:55.905904"], ["id", 1633]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1633], ["LIMIT", 1]]  (15.5ms) ROLLBACK  (25.5ms) BEGIN  (3.6ms) 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.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (3.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", "2020-12-22 13:50:56.342876"], ["updated_at", "2020-12-22 13:50:56.342876"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558656"], ["host", "example.test"]]  (8.8ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 Application Exists? (11.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.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 (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.416619"], ["updated_at", "2020-12-22 13:50:56.416619"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) 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.3ms) 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", 1634], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.6ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:50:56.489750"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1634]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.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", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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", "2020-12-22 13:50:56.504982"], ["updated_at", "2020-12-22 13:50:56.504982"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731456"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.512784"], ["updated_at", "2020-12-22 13:50:56.512784"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:50:56.520357"], ["updated_at", "2020-12-22 13:50:56.520357"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (10.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" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (12.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:56.540902"], ["updated_at", "2020-12-22 13:50:56.540902"], ["synced_id", 1], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", "2020-12-22 13:50:56.559340"], ["updated_at", "2020-12-22 13:50:56.559340"], ["synced_id", 2], ["host", "example.test"]]  (4.4ms) RELEASE SAVEPOINT active_record_1  (0.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", "example2.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:56.569042"], ["updated_at", "2020-12-22 13:50:56.569042"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:56.572676"], ["updated_at", "2020-12-22 13:50:56.572676"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:56.593245"], ["updated_at", "2020-12-22 13:50:56.593245"], ["synced_id", 123], ["host", "test.example"]]  (3.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.603010"], ["updated_at", "2020-12-22 13:50:56.603010"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.4ms) 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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.641320"], ["updated_at", "2020-12-22 13:50:56.641320"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists? (0.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 (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists? (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.675702"], ["updated_at", "2020-12-22 13:50:56.675702"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.718770"], ["updated_at", "2020-12-22 13:50:56.718770"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.723143"], ["updated_at", "2020-12-22 13:50:56.723143"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1643], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:50:56.729871"], ["id", 1643]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.742177"], ["updated_at", "2020-12-22 13:50:56.742177"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", "2020-12-22 13:50:56.745699"], ["updated_at", "2020-12-22 13:50:56.745699"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1645], ["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", "2020-12-22 13:50:56.751359"], ["id", 1645]]  (0.2ms) 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", 1645], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.758850"], ["updated_at", "2020-12-22 13:50:56.758850"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.764725"], ["updated_at", "2020-12-22 13:50:56.764725"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1647], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:50:56.770837"], ["id", 1647]]  (0.4ms) 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", 1647], ["LIMIT", 1]]  (4.4ms) ROLLBACK  (0.4ms) BEGIN  (6.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", "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", "2020-12-22 13:50:56.802200"], ["updated_at", "2020-12-22 13:50:56.802200"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (7.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "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.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.816250"], ["updated_at", "2020-12-22 13:50:56.816250"], ["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.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.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", "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", "2020-12-22 13:50:56.828041"], ["updated_at", "2020-12-22 13:50:56.828041"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.3ms) ROLLBACK  (3.8ms) 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]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "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", "2020-12-22 13:50:56.843484"], ["updated_at", "2020-12-22 13:50:56.843484"], ["provider", "bookingsync"], ["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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.847489"], ["updated_at", "2020-12-22 13:50:56.847489"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:50:56.856066"], ["updated_at", "2020-12-22 13:50:56.856066"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", "2020-12-22 13:50:56.860293"], ["updated_at", "2020-12-22 13:50:56.860293"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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? (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.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", "2020-12-22 13:50:56.869325"], ["updated_at", "2020-12-22 13:50:56.869325"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.873508"], ["updated_at", "2020-12-22 13:50:56.873508"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.879394"], ["updated_at", "2020-12-22 13:50:56.879394"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.882154"], ["updated_at", "2020-12-22 13:50:56.882154"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:56.893012"], ["updated_at", "2020-12-22 13:50:56.893012"], ["synced_id", 123], ["host", "test.example"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.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", "2020-12-22 13:50:56.898083"], ["updated_at", "2020-12-22 13:50:56.898083"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (4.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:56.909519"], ["updated_at", "2020-12-22 13:50:56.909519"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:56.914838"], ["updated_at", "2020-12-22 13:50:56.914838"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["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", "2020-12-22 13:50:56.920363"], ["updated_at", "2020-12-22 13:50:56.920363"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 3) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 41ms (Views: 24.6ms | ActiveRecord: 0.0ms | Allocations: 2227)  (0.5ms) ROLLBACK  (0.6ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms | Allocations: 184)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (Duration: 0.0ms | Allocations: 3) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms | Allocations: 366)  (0.2ms) ROLLBACK  (0.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 3ms (ActiveRecord: 0.0ms | Allocations: 108)  (0.6ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:57.038972"], ["updated_at", "2020-12-22 13:50:57.038972"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.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.3ms) 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", "2020-12-22 13:50:57.095549"], ["updated_at", "2020-12-22 13:50:57.095549"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.4ms) 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", "2020-12-22 13:50:57.118214"], ["updated_at", "2020-12-22 13:50:57.118214"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.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", "2020-12-22 13:50:57.133185"], ["updated_at", "2020-12-22 13:50:57.133185"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.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? (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.4ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:57.169840"], ["updated_at", "2020-12-22 13:50:57.169840"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.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? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:57.190343"], ["updated_at", "2020-12-22 13:50:57.190343"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:50:57.208091"], ["updated_at", "2020-12-22 13:50:57.208091"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:57.268968"], ["updated_at", "2020-12-22 13:50:57.268968"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:57.298083"], ["updated_at", "2020-12-22 13:50:57.298083"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.2ms) BEGIN  (1.8ms) SAVEPOINT active_record_1 Account Exists? (0.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", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:57.306772"], ["updated_at", "2020-12-22 13:50:57.306772"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (2.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) 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", "2020-12-22 13:50:57.346327"], ["updated_at", "2020-12-22 13:50:57.346327"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1691], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1691], ["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", "2020-12-22 13:50:57.350604"], ["id", 1691]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1691], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:57.358480"], ["updated_at", "2020-12-22 13:50:57.358480"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:57.361893"], ["updated_at", "2020-12-22 13:50:57.361893"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:57.365484"], ["updated_at", "2020-12-22 13:50:57.365484"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) 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", "2020-12-22 13:50:57.370265"], ["updated_at", "2020-12-22 13:50:57.370265"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731457"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:57.375793"], ["updated_at", "2020-12-22 13:50:57.375793"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558657"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1696], ["LIMIT", 1]] Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:50:57.402944"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1696]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:57.412558"], ["updated_at", "2020-12-22 13:50:57.412558"], ["synced_id", 1]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:57.415708"], ["updated_at", "2020-12-22 13:50:57.415708"], ["synced_id", 2]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:57.423245"], ["updated_at", "2020-12-22 13:50:57.423245"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.7ms) BEGIN Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:50:57.434580"], ["updated_at", "2020-12-22 13:50:57.434580"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:50:57.441562"], ["synced_id", 0], ["id", 1700]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.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", 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", "2020-12-22 13:50:57.454685"], ["updated_at", "2020-12-22 13:50:57.454685"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) 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.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:57.465349"], ["updated_at", "2020-12-22 13:50:57.465349"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "accounts"  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:57.476163"], ["updated_at", "2020-12-22 13:50:57.476163"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:57.479835"], ["updated_at", "2020-12-22 13:50:57.479835"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (7.1ms) 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", "2020-12-22 13:50:57.494605"], ["updated_at", "2020-12-22 13:50:57.494605"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:50:57.506378"], ["updated_at", "2020-12-22 13:50:57.506378"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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", "2020-12-22 13:50:57.513170"], ["updated_at", "2020-12-22 13:50:57.513170"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.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.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", "2020-12-22 13:50:57.519608"], ["updated_at", "2020-12-22 13:50:57.519608"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.8ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 Account Exists? (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:57.528226"], ["updated_at", "2020-12-22 13:50:57.528226"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:57.530682"], ["updated_at", "2020-12-22 13:50:57.530682"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.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]]  (2.7ms) 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", 1710], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:50:57.546373"], ["id", 1710]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1710], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (11.6ms) BEGIN  (1.6ms) SAVEPOINT active_record_1 Account Exists? (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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", "2020-12-22 13:50:57.573965"], ["updated_at", "2020-12-22 13:50:57.573965"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:57.577657"], ["updated_at", "2020-12-22 13:50:57.577657"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1712], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:50:57.581634"], ["id", 1712]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1712], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists? (6.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", "2020-12-22 13:50:57.595846"], ["updated_at", "2020-12-22 13:50:57.595846"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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 (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:57.604906"], ["updated_at", "2020-12-22 13:50:57.604906"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1714], ["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", "2020-12-22 13:50:57.608980"], ["id", 1714]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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", "2020-12-22 13:50:57.614490"], ["updated_at", "2020-12-22 13:50:57.614490"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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", "2020-12-22 13:50:57.617478"], ["updated_at", "2020-12-22 13:50:57.617478"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.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.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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 (0.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", "2020-12-22 13:50:57.623712"], ["id", 1716]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 167)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 118)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 2.5ms | Allocations: 262) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 33ms (Views: 9.2ms | ActiveRecord: 0.0ms | Allocations: 1926)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 0.2ms | Allocations: 54) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms | Allocations: 429)  (1.3ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 13:50:57.693607"], ["updated_at", "2020-12-22 13:50:57.693607"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 1.4ms | Allocations: 877)  (0.4ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 13:50:57.703004"], ["updated_at", "2020-12-22 13:50:57.703004"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 6ms (ActiveRecord: 2.9ms | Allocations: 874)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:50:57.714496"], ["updated_at", "2020-12-22 13:50:57.714496"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.5ms | Allocations: 966)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) 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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) 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]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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", "2020-12-22 13:50:57.729545"], ["updated_at", "2020-12-22 13:50:57.729545"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 6ms (ActiveRecord: 2.6ms | Allocations: 882)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:50:57.741246"], ["updated_at", "2020-12-22 13:50:57.741246"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:57.747700"], ["updated_at", "2020-12-22 13:50:57.747700"], ["synced_id", 123], ["host", "example.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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 (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:50:57.751988"], ["updated_at", "2020-12-22 13:50:57.751988"], ["synced_id", 123], ["host", "test.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.2ms) ROLLBACK  (0.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 9ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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 10ms (Views: 10.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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: 3.1ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (4.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:45.646634"], ["updated_at", "2020-12-22 13:53:45.646634"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:53:45.668649"], ["updated_at", "2020-12-22 13:53:45.668649"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:53:45.671174"], ["synced_id", 0], ["id", 1722]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:45.694853"], ["updated_at", "2020-12-22 13:53:45.694853"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:45.699221"], ["updated_at", "2020-12-22 13:53:45.699221"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:45.702483"], ["updated_at", "2020-12-22 13:53:45.702483"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.717990"], ["updated_at", "2020-12-22 13:53:45.717990"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.745123"], ["updated_at", "2020-12-22 13:53:45.745123"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558825"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1727], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:53:45.779613"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1727]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.798074"], ["updated_at", "2020-12-22 13:53:45.798074"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558825"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1728], ["LIMIT", 1]] SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:53:45.839540"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1728]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.843353"], ["updated_at", "2020-12-22 13:53:45.843353"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558825"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.850190"], ["updated_at", "2020-12-22 13:53:45.850190"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731625"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:45.853533"], ["updated_at", "2020-12-22 13:53:45.853533"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:45.874069"], ["updated_at", "2020-12-22 13:53:45.874069"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:45.894348"], ["updated_at", "2020-12-22 13:53:45.894348"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.899068"], ["updated_at", "2020-12-22 13:53:45.899068"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.902562"], ["updated_at", "2020-12-22 13:53:45.902562"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.905876"], ["updated_at", "2020-12-22 13:53:45.905876"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.909001"], ["updated_at", "2020-12-22 13:53:45.909001"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.913096"], ["updated_at", "2020-12-22 13:53:45.913096"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.915747"], ["updated_at", "2020-12-22 13:53:45.915747"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.922529"], ["updated_at", "2020-12-22 13:53:45.922529"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.925027"], ["updated_at", "2020-12-22 13:53:45.925027"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.929420"], ["updated_at", "2020-12-22 13:53:45.929420"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.931311"], ["updated_at", "2020-12-22 13:53:45.931311"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1743], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.935180"], ["id", 1743]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1743], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.938759"], ["updated_at", "2020-12-22 13:53:45.938759"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.940685"], ["updated_at", "2020-12-22 13:53:45.940685"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1745], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.944032"], ["id", 1745]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1745], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.949599"], ["updated_at", "2020-12-22 13:53:45.949599"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.953171"], ["updated_at", "2020-12-22 13:53:45.953171"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1747], ["LIMIT", 1]] SQL (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", "2020-12-22 13:53:45.957386"], ["id", 1747]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.962549"], ["updated_at", "2020-12-22 13:53:45.962549"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:45.965203"], ["updated_at", "2020-12-22 13:53:45.965203"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1749], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.968504"], ["id", 1749]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.971868"], ["updated_at", "2020-12-22 13:53:45.971868"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1750], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1750], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:45.974684"], ["id", 1750]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1750], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:45.979632"], ["updated_at", "2020-12-22 13:53:45.979632"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (7.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]] SQL (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", "2020-12-22 13:53:46.009211"], ["updated_at", "2020-12-22 13:53:46.009211"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1665], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1665], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:46.015110"], ["id", 1665]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1665], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:46.019795"], ["updated_at", "2020-12-22 13:53:46.019795"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (4.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.035609"], ["updated_at", "2020-12-22 13:53:46.035609"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.042676"], ["updated_at", "2020-12-22 13:53:46.042676"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:46.048078"], ["updated_at", "2020-12-22 13:53:46.048078"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.051371"], ["updated_at", "2020-12-22 13:53:46.051371"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.054286"], ["updated_at", "2020-12-22 13:53:46.054286"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.058145"], ["updated_at", "2020-12-22 13:53:46.058145"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.061533"], ["updated_at", "2020-12-22 13:53:46.061533"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.065143"], ["updated_at", "2020-12-22 13:53:46.065143"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.067181"], ["updated_at", "2020-12-22 13:53:46.067181"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1670], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:46.070197"], ["id", 1670]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.074393"], ["updated_at", "2020-12-22 13:53:46.074393"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.077278"], ["updated_at", "2020-12-22 13:53:46.077278"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1672], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:46.080939"], ["id", 1672]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1672], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.087192"], ["updated_at", "2020-12-22 13:53:46.087192"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.089630"], ["updated_at", "2020-12-22 13:53:46.089630"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1674], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:46.093094"], ["id", 1674]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1674], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.099048"], ["updated_at", "2020-12-22 13:53:46.099048"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:53:46.101201"], ["updated_at", "2020-12-22 13:53:46.101201"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:46.104890"], ["updated_at", "2020-12-22 13:53:46.104890"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:46.110400"], ["updated_at", "2020-12-22 13:53:46.110400"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.113443"], ["updated_at", "2020-12-22 13:53:46.113443"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:46.119263"], ["updated_at", "2020-12-22 13:53:46.119263"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.122264"], ["updated_at", "2020-12-22 13:53:46.122264"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:46.128587"], ["updated_at", "2020-12-22 13:53:46.128587"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.132101"], ["updated_at", "2020-12-22 13:53:46.132101"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.136885"], ["updated_at", "2020-12-22 13:53:46.136885"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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 (0.3ms) 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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:46.150075"], ["updated_at", "2020-12-22 13:53:46.150075"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731626"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.153621"], ["updated_at", "2020-12-22 13:53:46.153621"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:46.157613"], ["updated_at", "2020-12-22 13:53:46.157613"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558826"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.162041"], ["updated_at", "2020-12-22 13:53:46.162041"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1687], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:46.180611"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1687]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:46.184500"], ["updated_at", "2020-12-22 13:53:46.184500"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:46.186417"], ["updated_at", "2020-12-22 13:53:46.186417"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:46.188815"], ["updated_at", "2020-12-22 13:53:46.188815"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:46.190995"], ["updated_at", "2020-12-22 13:53:46.190995"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:46.196977"], ["updated_at", "2020-12-22 13:53:46.196977"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:46.201774"], ["updated_at", "2020-12-22 13:53:46.201774"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.205068"], ["updated_at", "2020-12-22 13:53:46.205068"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.241874"], ["updated_at", "2020-12-22 13:53:46.241874"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.248708"], ["updated_at", "2020-12-22 13:53:46.248708"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.260530"], ["updated_at", "2020-12-22 13:53:46.260530"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.277175"], ["updated_at", "2020-12-22 13:53:46.277175"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.289680"], ["updated_at", "2020-12-22 13:53:46.289680"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.298419"], ["updated_at", "2020-12-22 13:53:46.298419"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:46.313386"], ["updated_at", "2020-12-22 13:53:46.313386"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:46.323635"], ["updated_at", "2020-12-22 13:53:46.323635"], ["synced_id", 123]]  (2.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:46.335132"], ["updated_at", "2020-12-22 13:53:46.335132"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:46.337703"], ["updated_at", "2020-12-22 13:53:46.337703"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (5.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:46.353442"], ["updated_at", "2020-12-22 13:53:46.353442"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:46.364258"], ["updated_at", "2020-12-22 13:53:46.364258"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:46.371248"], ["updated_at", "2020-12-22 13:53:46.371248"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.8ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:46.405103"], ["updated_at", "2020-12-22 13:53:46.405103"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.9ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.4ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:58.709927"], ["updated_at", "2020-12-22 13:53:58.709927"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:58.741946"], ["updated_at", "2020-12-22 13:53:58.741946"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:58.780656"], ["updated_at", "2020-12-22 13:53:58.780656"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.809709"], ["updated_at", "2020-12-22 13:53:58.809709"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.817728"], ["updated_at", "2020-12-22 13:53:58.817728"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.822596"], ["updated_at", "2020-12-22 13:53:58.822596"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.825383"], ["updated_at", "2020-12-22 13:53:58.825383"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.829284"], ["updated_at", "2020-12-22 13:53:58.829284"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.832170"], ["updated_at", "2020-12-22 13:53:58.832170"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.835668"], ["updated_at", "2020-12-22 13:53:58.835668"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.838970"], ["updated_at", "2020-12-22 13:53:58.838970"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.844932"], ["updated_at", "2020-12-22 13:53:58.844932"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.847902"], ["updated_at", "2020-12-22 13:53:58.847902"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1768], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.854521"], ["id", 1768]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1768], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.859578"], ["updated_at", "2020-12-22 13:53:58.859578"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.861646"], ["updated_at", "2020-12-22 13:53:58.861646"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1770], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.865065"], ["id", 1770]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1770], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.869762"], ["updated_at", "2020-12-22 13:53:58.869762"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.872236"], ["updated_at", "2020-12-22 13:53:58.872236"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1772], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.875063"], ["id", 1772]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.879301"], ["updated_at", "2020-12-22 13:53:58.879301"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:58.881464"], ["updated_at", "2020-12-22 13:53:58.881464"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1774], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.884250"], ["id", 1774]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 13:53:58.888313"], ["updated_at", "2020-12-22 13:53:58.888313"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558838"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1775], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:53:58.907515"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1775]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.911656"], ["updated_at", "2020-12-22 13:53:58.911656"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558838"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.917235"], ["updated_at", "2020-12-22 13:53:58.917235"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558838"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1777], ["LIMIT", 1]] SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:53:58.937101"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1777]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.941699"], ["updated_at", "2020-12-22 13:53:58.941699"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731638"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:58.945787"], ["updated_at", "2020-12-22 13:53:58.945787"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:58.948225"], ["updated_at", "2020-12-22 13:53:58.948225"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:58.950589"], ["updated_at", "2020-12-22 13:53:58.950589"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.959359"], ["updated_at", "2020-12-22 13:53:58.959359"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1782], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1782], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 13:53:58.966048"], ["id", 1782]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1782], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:58.970226"], ["updated_at", "2020-12-22 13:53:58.970226"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:58.974789"], ["updated_at", "2020-12-22 13:53:58.974789"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.6ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:53:58.986928"], ["updated_at", "2020-12-22 13:53:58.986928"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:53:58.988910"], ["synced_id", 0], ["id", 1785]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:59.005238"], ["updated_at", "2020-12-22 13:53:59.005238"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (3.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.024155"], ["updated_at", "2020-12-22 13:53:59.024155"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.033523"], ["updated_at", "2020-12-22 13:53:59.033523"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.042454"], ["updated_at", "2020-12-22 13:53:59.042454"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.059263"], ["updated_at", "2020-12-22 13:53:59.059263"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.073532"], ["updated_at", "2020-12-22 13:53:59.073532"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.083207"], ["updated_at", "2020-12-22 13:53:59.083207"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.097222"], ["updated_at", "2020-12-22 13:53:59.097222"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:59.109181"], ["updated_at", "2020-12-22 13:53:59.109181"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 1.3ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:59.148311"], ["updated_at", "2020-12-22 13:53:59.148311"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (3.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:53:59.170024"], ["updated_at", "2020-12-22 13:53:59.170024"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 14ms (ActiveRecord: 3.2ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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]] SQL (0.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", "2020-12-22 13:53:59.180258"], ["updated_at", "2020-12-22 13:53:59.180258"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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: 8.7ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:53:59.217040"], ["updated_at", "2020-12-22 13:53:59.217040"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.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", "example.host"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:59.222606"], ["updated_at", "2020-12-22 13:53:59.222606"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:59.224890"], ["updated_at", "2020-12-22 13:53:59.224890"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:59.231955"], ["updated_at", "2020-12-22 13:53:59.231955"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.235053"], ["updated_at", "2020-12-22 13:53:59.235053"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:59.257707"], ["updated_at", "2020-12-22 13:53:59.257707"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.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", 2], ["host", "example.test"], ["LIMIT", 1]] SQL (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:59.261816"], ["updated_at", "2020-12-22 13:53:59.261816"], ["synced_id", 2], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:59.266471"], ["updated_at", "2020-12-22 13:53:59.266471"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:59.269131"], ["updated_at", "2020-12-22 13:53:59.269131"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:59.274867"], ["updated_at", "2020-12-22 13:53:59.274867"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.280409"], ["updated_at", "2020-12-22 13:53:59.280409"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.282692"], ["updated_at", "2020-12-22 13:53:59.282692"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.287034"], ["updated_at", "2020-12-22 13:53:59.287034"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.290033"], ["updated_at", "2020-12-22 13:53:59.290033"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:59.294335"], ["updated_at", "2020-12-22 13:53:59.294335"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:59.300839"], ["updated_at", "2020-12-22 13:53:59.300839"], ["provider", "bookingsync"], ["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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.305708"], ["updated_at", "2020-12-22 13:53:59.305708"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) 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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:59.317897"], ["updated_at", "2020-12-22 13:53:59.317897"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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]] SQL (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", "2020-12-22 13:53:59.322350"], ["updated_at", "2020-12-22 13:53:59.322350"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) 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]]  (2.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]] SQL (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", "2020-12-22 13:53:59.332611"], ["updated_at", "2020-12-22 13:53:59.332611"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.335545"], ["updated_at", "2020-12-22 13:53:59.335545"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:53:59.339599"], ["updated_at", "2020-12-22 13:53:59.339599"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (1.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.349205"], ["updated_at", "2020-12-22 13:53:59.349205"], ["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.2ms) 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", 1717], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:59.354750"], ["id", 1717]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:53:59.359751"], ["updated_at", "2020-12-22 13:53:59.359751"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.363990"], ["updated_at", "2020-12-22 13:53:59.363990"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1719], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:59.367241"], ["id", 1719]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1719], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.373195"], ["updated_at", "2020-12-22 13:53:59.373195"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.375817"], ["updated_at", "2020-12-22 13:53:59.375817"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1721], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:59.381222"], ["id", 1721]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1721], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:59.387318"], ["updated_at", "2020-12-22 13:53:59.387318"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.392089"], ["updated_at", "2020-12-22 13:53:59.392089"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:53:59.397770"], ["updated_at", "2020-12-22 13:53:59.397770"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.401411"], ["updated_at", "2020-12-22 13:53:59.401411"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.405760"], ["updated_at", "2020-12-22 13:53:59.405760"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:59.410377"], ["updated_at", "2020-12-22 13:53:59.410377"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1725], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1725], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:53:59.414621"], ["id", 1725]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1725], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.421314"], ["updated_at", "2020-12-22 13:53:59.421314"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.427274"], ["updated_at", "2020-12-22 13:53:59.427274"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:59.438104"], ["updated_at", "2020-12-22 13:53:59.438104"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558839"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.442157"], ["updated_at", "2020-12-22 13:53:59.442157"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1727], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:53:59.460332"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1727]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:53:59.464355"], ["updated_at", "2020-12-22 13:53:59.464355"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731639"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:53:59.467685"], ["updated_at", "2020-12-22 13:53:59.467685"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.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: 3.0ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.217318"], ["updated_at", "2020-12-22 13:54:12.217318"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.220998"], ["updated_at", "2020-12-22 13:54:12.220998"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.226862"], ["updated_at", "2020-12-22 13:54:12.226862"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.228968"], ["updated_at", "2020-12-22 13:54:12.228968"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1731], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:54:12.235652"], ["id", 1731]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.241596"], ["updated_at", "2020-12-22 13:54:12.241596"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.244357"], ["updated_at", "2020-12-22 13:54:12.244357"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1733], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:54:12.247629"], ["id", 1733]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1733], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.251948"], ["updated_at", "2020-12-22 13:54:12.251948"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.253797"], ["updated_at", "2020-12-22 13:54:12.253797"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1735], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:54:12.257169"], ["id", 1735]]  (0.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1735], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.262217"], ["updated_at", "2020-12-22 13:54:12.262217"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.264420"], ["updated_at", "2020-12-22 13:54:12.264420"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:54:12.272725"], ["updated_at", "2020-12-22 13:54:12.272725"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:54:12.278514"], ["updated_at", "2020-12-22 13:54:12.278514"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.281427"], ["updated_at", "2020-12-22 13:54:12.281427"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:54:12.286128"], ["updated_at", "2020-12-22 13:54:12.286128"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.288589"], ["updated_at", "2020-12-22 13:54:12.288589"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:54:12.294739"], ["updated_at", "2020-12-22 13:54:12.294739"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.298341"], ["updated_at", "2020-12-22 13:54:12.298341"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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", "2020-12-22 13:54:12.303194"], ["updated_at", "2020-12-22 13:54:12.303194"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558852"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (11.5ms) 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 (0.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", "2020-12-22 13:54:12.321094"], ["updated_at", "2020-12-22 13:54:12.321094"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (3.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1746], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:54:12.411985"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1746]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:54:12.424652"], ["updated_at", "2020-12-22 13:54:12.424652"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731652"], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.431288"], ["updated_at", "2020-12-22 13:54:12.431288"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (2.9ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) 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", "2020-12-22 13:54:12.442421"], ["updated_at", "2020-12-22 13:54:12.442421"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (1.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.458464"], ["updated_at", "2020-12-22 13:54:12.458464"], ["synced_id", 123], ["host", "test.example"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.465060"], ["updated_at", "2020-12-22 13:54:12.465060"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) 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.4ms) 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", "2020-12-22 13:54:12.473233"], ["updated_at", "2020-12-22 13:54:12.473233"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.5ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:54:12.519251"], ["updated_at", "2020-12-22 13:54:12.519251"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1750], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1750], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:54:12.527143"], ["id", 1750]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1750], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.540815"], ["updated_at", "2020-12-22 13:54:12.540815"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (5.1ms) 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", "2020-12-22 13:54:12.554155"], ["updated_at", "2020-12-22 13:54:12.554155"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.4ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.585675"], ["updated_at", "2020-12-22 13:54:12.585675"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.588866"], ["updated_at", "2020-12-22 13:54:12.588866"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.591411"], ["updated_at", "2020-12-22 13:54:12.591411"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.595289"], ["updated_at", "2020-12-22 13:54:12.595289"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.604333"], ["updated_at", "2020-12-22 13:54:12.604333"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) 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.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.612450"], ["updated_at", "2020-12-22 13:54:12.612450"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.621461"], ["updated_at", "2020-12-22 13:54:12.621461"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) 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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.628967"], ["updated_at", "2020-12-22 13:54:12.628967"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.4ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.657156"], ["updated_at", "2020-12-22 13:54:12.657156"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) 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", "2020-12-22 13:54:12.672368"], ["updated_at", "2020-12-22 13:54:12.672368"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.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 (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.685234"], ["updated_at", "2020-12-22 13:54:12.685234"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.697791"], ["updated_at", "2020-12-22 13:54:12.697791"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.714678"], ["updated_at", "2020-12-22 13:54:12.714678"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:12.732864"], ["updated_at", "2020-12-22 13:54:12.732864"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) 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.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", "2020-12-22 13:54:12.764757"], ["updated_at", "2020-12-22 13:54:12.764757"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:12.769954"], ["updated_at", "2020-12-22 13:54:12.769954"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1792], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1792], ["LIMIT", 1]] Account Update (0.2ms) 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", "2020-12-22 13:54:12.773473"], ["id", 1792]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1792], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:12.778375"], ["updated_at", "2020-12-22 13:54:12.778375"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:12.780409"], ["updated_at", "2020-12-22 13:54:12.780409"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:12.782106"], ["updated_at", "2020-12-22 13:54:12.782106"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:54:12.791228"], ["updated_at", "2020-12-22 13:54:12.791228"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:54:12.792640"], ["synced_id", 0], ["id", 1796]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:12.798437"], ["updated_at", "2020-12-22 13:54:12.798437"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:12.802168"], ["updated_at", "2020-12-22 13:54:12.802168"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:12.821635"], ["updated_at", "2020-12-22 13:54:12.821635"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:12.847917"], ["updated_at", "2020-12-22 13:54:12.847917"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:12.876590"], ["updated_at", "2020-12-22 13:54:12.876590"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558852"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1801], ["LIMIT", 1]] Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:54:12.896674"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1801]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:12.900250"], ["updated_at", "2020-12-22 13:54:12.900250"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558852"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:12.905452"], ["updated_at", "2020-12-22 13:54:12.905452"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558852"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1803], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:54:12.924047"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1803]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.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", "2020-12-22 13:54:12.928929"], ["updated_at", "2020-12-22 13:54:12.928929"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731652"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.934520"], ["updated_at", "2020-12-22 13:54:12.934520"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.936556"], ["updated_at", "2020-12-22 13:54:12.936556"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) 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 (0.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", "2020-12-22 13:54:12.939406"], ["id", 1806]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1806], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.944081"], ["updated_at", "2020-12-22 13:54:12.944081"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.946008"], ["updated_at", "2020-12-22 13:54:12.946008"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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.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", "2020-12-22 13:54:12.948586"], ["id", 1808]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1808], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.956005"], ["updated_at", "2020-12-22 13:54:12.956005"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.958284"], ["updated_at", "2020-12-22 13:54:12.958284"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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.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", "2020-12-22 13:54:12.961748"], ["id", 1810]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.966326"], ["updated_at", "2020-12-22 13:54:12.966326"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.968620"], ["updated_at", "2020-12-22 13:54:12.968620"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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.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", "2020-12-22 13:54:12.971998"], ["id", 1812]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.976340"], ["updated_at", "2020-12-22 13:54:12.976340"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:12.979463"], ["updated_at", "2020-12-22 13:54:12.979463"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.983266"], ["updated_at", "2020-12-22 13:54:12.983266"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:12.986755"], ["updated_at", "2020-12-22 13:54:12.986755"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["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", "2020-12-22 13:54:12.991098"], ["updated_at", "2020-12-22 13:54:12.991098"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:12.995266"], ["updated_at", "2020-12-22 13:54:12.995266"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:12.999078"], ["updated_at", "2020-12-22 13:54:12.999078"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 13:54:13.002765"], ["updated_at", "2020-12-22 13:54:13.002765"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:13.007408"], ["updated_at", "2020-12-22 13:54:13.007408"], ["synced_id", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.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 9ms (Views: 9.2ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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.6ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 5ms (Views: 2.9ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:13.099640"], ["updated_at", "2020-12-22 13:54:13.099640"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:13.106046"], ["updated_at", "2020-12-22 13:54:13.106046"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 3ms (ActiveRecord: 0.9ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 13:54:13.116237"], ["updated_at", "2020-12-22 13:54:13.116237"], ["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.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.1ms)  (0.5ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2020-12-22 13:54:13.128043"], ["updated_at", "2020-12-22 13:54:13.128043"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:13.146382"], ["updated_at", "2020-12-22 13:54:13.146382"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:13.148821"], ["updated_at", "2020-12-22 13:54:13.148821"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:13.154422"], ["updated_at", "2020-12-22 13:54:13.154422"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:13.160332"], ["updated_at", "2020-12-22 13:54:13.160332"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) 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.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.258881"], ["updated_at", "2020-12-22 13:54:26.258881"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.262754"], ["updated_at", "2020-12-22 13:54:26.262754"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:54:26.270481"], ["updated_at", "2020-12-22 13:54:26.270481"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.3ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:54:26.327086"], ["updated_at", "2020-12-22 13:54:26.327086"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.329461"], ["updated_at", "2020-12-22 13:54:26.329461"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) 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.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", "example3.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.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", "2020-12-22 13:54:26.338720"], ["updated_at", "2020-12-22 13:54:26.338720"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_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", "2020-12-22 13:54:26.343501"], ["updated_at", "2020-12-22 13:54:26.343501"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:54:26.348196"], ["updated_at", "2020-12-22 13:54:26.348196"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.350471"], ["updated_at", "2020-12-22 13:54:26.350471"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.356035"], ["updated_at", "2020-12-22 13:54:26.356035"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.358227"], ["updated_at", "2020-12-22 13:54:26.358227"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1770], ["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", "2020-12-22 13:54:26.362643"], ["id", 1770]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (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", "2020-12-22 13:54:26.367547"], ["updated_at", "2020-12-22 13:54:26.367547"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.370404"], ["updated_at", "2020-12-22 13:54:26.370404"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1772], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:54:26.373600"], ["id", 1772]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1772], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.379040"], ["updated_at", "2020-12-22 13:54:26.379040"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.381303"], ["updated_at", "2020-12-22 13:54:26.381303"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1774], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:54:26.384816"], ["id", 1774]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1774], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.389100"], ["updated_at", "2020-12-22 13:54:26.389100"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.391280"], ["updated_at", "2020-12-22 13:54:26.391280"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.398315"], ["updated_at", "2020-12-22 13:54:26.398315"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.401564"], ["updated_at", "2020-12-22 13:54:26.401564"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.403577"], ["updated_at", "2020-12-22 13:54:26.403577"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.405391"], ["updated_at", "2020-12-22 13:54:26.405391"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:54:26.409990"], ["updated_at", "2020-12-22 13:54:26.409990"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.418616"], ["updated_at", "2020-12-22 13:54:26.418616"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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? (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.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", "2020-12-22 13:54:26.434040"], ["updated_at", "2020-12-22 13:54:26.434040"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.468624"], ["updated_at", "2020-12-22 13:54:26.468624"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists? (0.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 (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists? (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.6ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.494860"], ["updated_at", "2020-12-22 13:54:26.494860"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.500802"], ["updated_at", "2020-12-22 13:54:26.500802"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.504325"], ["updated_at", "2020-12-22 13:54:26.504325"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.509265"], ["updated_at", "2020-12-22 13:54:26.509265"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.540137"], ["updated_at", "2020-12-22 13:54:26.540137"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.545638"], ["updated_at", "2020-12-22 13:54:26.545638"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 13:54:26.552168"], ["updated_at", "2020-12-22 13:54:26.552168"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731666"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.556188"], ["updated_at", "2020-12-22 13:54:26.556188"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 13:54:26.561286"], ["updated_at", "2020-12-22 13:54:26.561286"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558866"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.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 (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.566058"], ["updated_at", "2020-12-22 13:54:26.566058"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) 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", 1788], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:54:26.590092"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1788]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:54:26.595044"], ["updated_at", "2020-12-22 13:54:26.595044"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) 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", 1789], ["LIMIT", 1]]  (0.2ms) 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"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1789], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 13:54:26.600344"], ["id", 1789]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1789], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) 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]]  (0.2ms) 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", "2020-12-22 13:54:26.659242"], ["updated_at", "2020-12-22 13:54:26.659242"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 23ms (ActiveRecord: 7.2ms | Allocations: 7304)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.666525"], ["updated_at", "2020-12-22 13:54:26.666525"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 4ms (ActiveRecord: 1.0ms | Allocations: 875)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.677508"], ["updated_at", "2020-12-22 13:54:26.677508"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.3ms | Allocations: 882)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 13:54:26.686640"], ["updated_at", "2020-12-22 13:54:26.686640"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 3ms (ActiveRecord: 0.9ms | Allocations: 966)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 119)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 118)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 2.3ms | Allocations: 264) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 47ms (Views: 11.1ms | ActiveRecord: 0.0ms | Allocations: 2704)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 0.2ms | Allocations: 54) 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 | Allocations: 429)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.756661"], ["updated_at", "2020-12-22 13:54:26.756661"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.760999"], ["updated_at", "2020-12-22 13:54:26.760999"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.764438"], ["updated_at", "2020-12-22 13:54:26.764438"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.767066"], ["updated_at", "2020-12-22 13:54:26.767066"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.770096"], ["updated_at", "2020-12-22 13:54:26.770096"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.772828"], ["updated_at", "2020-12-22 13:54:26.772828"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.776002"], ["updated_at", "2020-12-22 13:54:26.776002"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.779936"], ["updated_at", "2020-12-22 13:54:26.779936"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.784599"], ["updated_at", "2020-12-22 13:54:26.784599"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.786518"], ["updated_at", "2020-12-22 13:54:26.786518"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1838], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:54:26.789109"], ["id", 1838]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1838], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.7ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.795743"], ["updated_at", "2020-12-22 13:54:26.795743"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.798275"], ["updated_at", "2020-12-22 13:54:26.798275"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1840], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:54:26.802108"], ["id", 1840]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1840], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.806220"], ["updated_at", "2020-12-22 13:54:26.806220"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.808104"], ["updated_at", "2020-12-22 13:54:26.808104"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1842], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:54:26.811527"], ["id", 1842]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.815035"], ["updated_at", "2020-12-22 13:54:26.815035"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:26.817668"], ["updated_at", "2020-12-22 13:54:26.817668"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1844], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 13:54:26.820130"], ["id", 1844]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:26.824012"], ["updated_at", "2020-12-22 13:54:26.824012"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:26.828016"], ["updated_at", "2020-12-22 13:54:26.828016"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:26.830763"], ["updated_at", "2020-12-22 13:54:26.830763"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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", "2020-12-22 13:54:26.832799"], ["updated_at", "2020-12-22 13:54:26.832799"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.838193"], ["updated_at", "2020-12-22 13:54:26.838193"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:54:26.842343"], ["updated_at", "2020-12-22 13:54:26.842343"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:54:26.844894"], ["synced_id", 0], ["id", 1850]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists? (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.853299"], ["updated_at", "2020-12-22 13:54:26.853299"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558866"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1851], ["LIMIT", 1]] Account Update (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:54:26.872588"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1851]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.876219"], ["updated_at", "2020-12-22 13:54:26.876219"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558866"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) 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 (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:54:26.894955"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1852]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.899274"], ["updated_at", "2020-12-22 13:54:26.899274"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558866"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.903544"], ["updated_at", "2020-12-22 13:54:26.903544"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731666"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:26.906654"], ["updated_at", "2020-12-22 13:54:26.906654"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:26.924037"], ["updated_at", "2020-12-22 13:54:26.924037"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:26.928510"], ["updated_at", "2020-12-22 13:54:26.928510"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 13:54:26.951517"], ["updated_at", "2020-12-22 13:54:26.951517"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1858], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1858], ["LIMIT", 1]] Account Update (0.2ms) 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", "2020-12-22 13:54:26.954528"], ["id", 1858]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1858], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:26.958252"], ["updated_at", "2020-12-22 13:54:26.958252"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:26.963922"], ["updated_at", "2020-12-22 13:54:26.963922"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) 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", "2020-12-22 13:54:26.970585"], ["updated_at", "2020-12-22 13:54:26.970585"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.4ms) 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", "2020-12-22 13:54:26.983221"], ["updated_at", "2020-12-22 13:54:26.983221"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) 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? (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) 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.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:27.004178"], ["updated_at", "2020-12-22 13:54:27.004178"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:27.018829"], ["updated_at", "2020-12-22 13:54:27.018829"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:27.027377"], ["updated_at", "2020-12-22 13:54:27.027377"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:54:27.036149"], ["updated_at", "2020-12-22 13:54:27.036149"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 4ms (Views: 3.0ms | ActiveRecord: 0.0ms | Allocations: 558)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 165)  (0.1ms) ROLLBACK  (0.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 | Allocations: 94)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (Duration: 0.0ms | Allocations: 3) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms | Allocations: 365)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:54:27.081166"], ["updated_at", "2020-12-22 13:54:27.081166"], ["synced_id", 123]]  (0.2ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:27.087592"], ["updated_at", "2020-12-22 13:54:27.087592"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:54:27.090326"], ["updated_at", "2020-12-22 13:54:27.090326"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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]] SQL (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.271655"], ["updated_at", "2020-12-22 13:55:18.271655"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (2.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.282163"], ["updated_at", "2020-12-22 13:55:18.282163"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (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", "2020-12-22 13:55:18.306975"], ["updated_at", "2020-12-22 13:55:18.306975"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.313745"], ["updated_at", "2020-12-22 13:55:18.313745"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.324433"], ["updated_at", "2020-12-22 13:55:18.324433"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.327152"], ["updated_at", "2020-12-22 13:55:18.327152"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) 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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1796], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.334800"], ["id", 1796]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.342100"], ["updated_at", "2020-12-22 13:55:18.342100"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 13:55:18.344890"], ["updated_at", "2020-12-22 13:55:18.344890"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1798], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.354574"], ["id", 1798]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1798], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.359086"], ["updated_at", "2020-12-22 13:55:18.359086"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.361243"], ["updated_at", "2020-12-22 13:55:18.361243"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1800], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.364782"], ["id", 1800]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1800], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.369672"], ["updated_at", "2020-12-22 13:55:18.369672"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.371902"], ["updated_at", "2020-12-22 13:55:18.371902"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:55:18.381252"], ["updated_at", "2020-12-22 13:55:18.381252"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:55:18.386569"], ["updated_at", "2020-12-22 13:55:18.386569"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.389324"], ["updated_at", "2020-12-22 13:55:18.389324"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:55:18.394219"], ["updated_at", "2020-12-22 13:55:18.394219"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.396806"], ["updated_at", "2020-12-22 13:55:18.396806"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:55:18.405970"], ["updated_at", "2020-12-22 13:55:18.405970"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.410022"], ["updated_at", "2020-12-22 13:55:18.410022"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:55:18.416442"], ["updated_at", "2020-12-22 13:55:18.416442"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1811], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1811], ["host", "example.test"], ["LIMIT", 1]] SQL (0.6ms) 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", "2020-12-22 13:55:18.430415"], ["id", 1811]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1811], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.439614"], ["updated_at", "2020-12-22 13:55:18.439614"], ["synced_id", 123], ["host", "test.example"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.448823"], ["updated_at", "2020-12-22 13:55:18.448823"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.452124"], ["updated_at", "2020-12-22 13:55:18.452124"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:55:18.462877"], ["updated_at", "2020-12-22 13:55:18.462877"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731718"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.467301"], ["updated_at", "2020-12-22 13:55:18.467301"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:55:18.472474"], ["updated_at", "2020-12-22 13:55:18.472474"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558918"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.475976"], ["updated_at", "2020-12-22 13:55:18.475976"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1814], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 13:55:18.514239"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1814]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.519211"], ["updated_at", "2020-12-22 13:55:18.519211"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.523716"], ["updated_at", "2020-12-22 13:55:18.523716"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.546579"], ["updated_at", "2020-12-22 13:55:18.546579"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.551170"], ["updated_at", "2020-12-22 13:55:18.551170"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.554437"], ["updated_at", "2020-12-22 13:55:18.554437"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.558147"], ["updated_at", "2020-12-22 13:55:18.558147"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:55:18.564681"], ["updated_at", "2020-12-22 13:55:18.564681"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.569395"], ["updated_at", "2020-12-22 13:55:18.569395"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:18.590653"], ["updated_at", "2020-12-22 13:55:18.590653"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one 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]] SQL (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.680642"], ["updated_at", "2020-12-22 13:55:18.680642"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.685126"], ["updated_at", "2020-12-22 13:55:18.685126"], ["synced_id", 123], ["host", "test.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:55:18.713217"], ["updated_at", "2020-12-22 13:55:18.713217"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 13:55:18.725634"], ["updated_at", "2020-12-22 13:55:18.725634"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 10ms (ActiveRecord: 1.6ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.740412"], ["updated_at", "2020-12-22 13:55:18.740412"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 1.2ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.749563"], ["updated_at", "2020-12-22 13:55:18.749563"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.4ms)  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 13:55:18.758417"], ["updated_at", "2020-12-22 13:55:18.758417"], ["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.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 4ms (ActiveRecord: 0.9ms)  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.2ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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.7ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.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 5ms (Views: 4.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 4ms (Views: 3.3ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:55:18.839536"], ["updated_at", "2020-12-22 13:55:18.839536"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:55:18.844617"], ["updated_at", "2020-12-22 13:55:18.844617"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:55:18.846514"], ["updated_at", "2020-12-22 13:55:18.846514"], ["synced_id", 2]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:55:18.849137"], ["updated_at", "2020-12-22 13:55:18.849137"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.853395"], ["updated_at", "2020-12-22 13:55:18.853395"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1869], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1869], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.857233"], ["id", 1869]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1869], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.861643"], ["updated_at", "2020-12-22 13:55:18.861643"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558918"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1870], ["LIMIT", 1]] SQL (0.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 13:55:18.878943"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1870]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.882458"], ["updated_at", "2020-12-22 13:55:18.882458"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558918"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.887067"], ["updated_at", "2020-12-22 13:55:18.887067"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608558918"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.890914"], ["updated_at", "2020-12-22 13:55:18.890914"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608731718"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.2ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 13:55:18.901317"], ["updated_at", "2020-12-22 13:55:18.901317"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 13:55:18.902945"], ["synced_id", 0], ["id", 1874]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:55:18.908844"], ["updated_at", "2020-12-22 13:55:18.908844"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (1.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:55:18.932043"], ["updated_at", "2020-12-22 13:55:18.932043"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:55:18.942472"], ["updated_at", "2020-12-22 13:55:18.942472"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.965224"], ["updated_at", "2020-12-22 13:55:18.965224"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.968788"], ["updated_at", "2020-12-22 13:55:18.968788"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.970699"], ["updated_at", "2020-12-22 13:55:18.970699"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1880], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.973332"], ["id", 1880]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.976728"], ["updated_at", "2020-12-22 13:55:18.976728"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.978433"], ["updated_at", "2020-12-22 13:55:18.978433"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) 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.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1882], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.982526"], ["id", 1882]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.985836"], ["updated_at", "2020-12-22 13:55:18.985836"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.988122"], ["updated_at", "2020-12-22 13:55:18.988122"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1884], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:18.991087"], ["id", 1884]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1884], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.995243"], ["updated_at", "2020-12-22 13:55:18.995243"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:18.997202"], ["updated_at", "2020-12-22 13:55:18.997202"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1886], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:19.000570"], ["id", 1886]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1886], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:19.005281"], ["updated_at", "2020-12-22 13:55:19.005281"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts" Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:19.008159"], ["updated_at", "2020-12-22 13:55:19.008159"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:19.011358"], ["updated_at", "2020-12-22 13:55:19.011358"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:19.014835"], ["updated_at", "2020-12-22 13:55:19.014835"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:19.018609"], ["updated_at", "2020-12-22 13:55:19.018609"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:19.021430"], ["updated_at", "2020-12-22 13:55:19.021430"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 13:55:19.025410"], ["updated_at", "2020-12-22 13:55:19.025410"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 13:55:19.028171"], ["updated_at", "2020-12-22 13:55:19.028171"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 13:55:19.031626"], ["updated_at", "2020-12-22 13:55:19.031626"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:19.042194"], ["updated_at", "2020-12-22 13:55:19.042194"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) 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]] SQL (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:19.055310"], ["updated_at", "2020-12-22 13:55:19.055310"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:19.077011"], ["updated_at", "2020-12-22 13:55:19.077011"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:19.086057"], ["updated_at", "2020-12-22 13:55:19.086057"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:19.094006"], ["updated_at", "2020-12-22 13:55:19.094006"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:19.106949"], ["updated_at", "2020-12-22 13:55:19.106949"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 13:55:19.128388"], ["updated_at", "2020-12-22 13:55:19.128388"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (3.1ms) SAVEPOINT active_record_1 Account Exists (4.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (4.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", "2020-12-22 14:06:24.555155"], ["updated_at", "2020-12-22 14:06:24.555155"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.4ms) ROLLBACK  (0.4ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:06:25.312729"], ["updated_at", "2020-12-22 14:06:25.312729"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (45.5ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 14:06:25.416076"], ["updated_at", "2020-12-22 14:06:25.416076"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 14:06:25.421269"], ["synced_id", 0], ["id", 1898]]  (0.2ms) 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.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (2.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.462799"], ["updated_at", "2020-12-22 14:06:25.462799"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (6.1ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 14:06:25.484938"], ["updated_at", "2020-12-22 14:06:25.484938"], ["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.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.496897"], ["updated_at", "2020-12-22 14:06:25.496897"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.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.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]] SQL (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", "2020-12-22 14:06:25.504457"], ["updated_at", "2020-12-22 14:06:25.504457"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.515315"], ["updated_at", "2020-12-22 14:06:25.515315"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.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 (18.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 14:06:25.555508"], ["updated_at", "2020-12-22 14:06:25.555508"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.567079"], ["updated_at", "2020-12-22 14:06:25.567079"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:06:25.583997"], ["updated_at", "2020-12-22 14:06:25.583997"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.598928"], ["updated_at", "2020-12-22 14:06:25.598928"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.631997"], ["updated_at", "2020-12-22 14:06:25.631997"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1908], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:06:25.651560"], ["id", 1908]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1908], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.686482"], ["updated_at", "2020-12-22 14:06:25.686482"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.7ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.698759"], ["updated_at", "2020-12-22 14:06:25.698759"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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", 1910], ["LIMIT", 1]] SQL (10.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", "2020-12-22 14:06:25.716346"], ["id", 1910]]  (0.6ms) RELEASE SAVEPOINT active_record_1 Account Load (21.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1910], ["LIMIT", 1]]  (3.5ms) ROLLBACK  (0.1ms) BEGIN  (28.9ms) SAVEPOINT active_record_1 Account Exists (8.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (8.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.802332"], ["updated_at", "2020-12-22 14:06:25.802332"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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]] SQL (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.832267"], ["updated_at", "2020-12-22 14:06:25.832267"], ["provider", "bookingsync"], ["synced_id", 123]]  (2.9ms) RELEASE SAVEPOINT active_record_1 Account Load (5.9ms) 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.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1912], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:06:25.893507"], ["id", 1912]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.924732"], ["updated_at", "2020-12-22 14:06:25.924732"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:25.931168"], ["updated_at", "2020-12-22 14:06:25.931168"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1914], ["LIMIT", 1]] SQL (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", "2020-12-22 14:06:25.946589"], ["id", 1914]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (0.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", "2020-12-22 14:06:25.951384"], ["updated_at", "2020-12-22 14:06:25.951384"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1915], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1915], ["LIMIT", 1]] SQL (0.2ms) 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", "2020-12-22 14:06:25.955398"], ["id", 1915]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1915], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:06:25.961593"], ["updated_at", "2020-12-22 14:06:25.961593"], ["synced_id", 1]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:06:25.964173"], ["updated_at", "2020-12-22 14:06:25.964173"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:06:25.967185"], ["updated_at", "2020-12-22 14:06:25.967185"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:06:25.982708"], ["updated_at", "2020-12-22 14:06:25.982708"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608732385"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (3.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]] SQL (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", "2020-12-22 14:06:25.993380"], ["updated_at", "2020-12-22 14:06:25.993380"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559585"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.5ms) 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", 1920], ["LIMIT", 1]] SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 14:06:26.164198"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1920]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (3.4ms) BEGIN  (0.3ms) 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]] SQL (0.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", "2020-12-22 14:06:26.179367"], ["updated_at", "2020-12-22 14:06:26.179367"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559586"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.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", 1921], ["LIMIT", 1]] SQL (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 14:06:26.290781"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1921]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:06:26.300402"], ["updated_at", "2020-12-22 14:06:26.300402"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559586"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:06:26.425169"], ["updated_at", "2020-12-22 14:06:26.425169"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:06:26.429118"], ["updated_at", "2020-12-22 14:06:26.429118"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:06:26.480618"], ["updated_at", "2020-12-22 14:06:26.480618"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:06:26.517473"], ["updated_at", "2020-12-22 14:06:26.517473"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (6.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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (4.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:26.560475"], ["updated_at", "2020-12-22 14:06:26.560475"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (1.3ms) 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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.7ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) 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", 123], ["host", "test.example"], ["LIMIT", 1]] SQL (4.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:26.653179"], ["updated_at", "2020-12-22 14:06:26.653179"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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]] SQL (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:26.665582"], ["updated_at", "2020-12-22 14:06:26.665582"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (5.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:26.685012"], ["updated_at", "2020-12-22 14:06:26.685012"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:26.688264"], ["updated_at", "2020-12-22 14:06:26.688264"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:26.691662"], ["updated_at", "2020-12-22 14:06:26.691662"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:26.693943"], ["updated_at", "2020-12-22 14:06:26.693943"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:26.698725"], ["updated_at", "2020-12-22 14:06:26.698725"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:26.707766"], ["updated_at", "2020-12-22 14:06:26.707766"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (16.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]] SQL (0.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", "2020-12-22 14:06:26.782517"], ["updated_at", "2020-12-22 14:06:26.782517"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608732386"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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 (7.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:26.810837"], ["updated_at", "2020-12-22 14:06:26.810837"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:06:26.815834"], ["updated_at", "2020-12-22 14:06:26.815834"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559586"], ["host", "example.test"]]  (4.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:26.826159"], ["updated_at", "2020-12-22 14:06:26.826159"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.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", 1832], ["host", "example.test"], ["LIMIT", 1]] SQL (0.5ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 14:06:26.860799"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1832]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (4.5ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) 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]] SQL (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", "2020-12-22 14:06:26.888293"], ["updated_at", "2020-12-22 14:06:26.888293"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1833], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1833], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 14:06:26.895928"], ["id", 1833]]  (0.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", 1833], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (4.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:26.904055"], ["updated_at", "2020-12-22 14:06:26.904055"], ["synced_id", 123], ["host", "test.example"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:26.914439"], ["updated_at", "2020-12-22 14:06:26.914439"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:26.918990"], ["updated_at", "2020-12-22 14:06:26.918990"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:06:26.928441"], ["updated_at", "2020-12-22 14:06:26.928441"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:06:26.947498"], ["updated_at", "2020-12-22 14:06:26.947498"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:26.961696"], ["updated_at", "2020-12-22 14:06:26.961696"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (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", "2020-12-22 14:06:26.970385"], ["updated_at", "2020-12-22 14:06:26.970385"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:06:26.979719"], ["updated_at", "2020-12-22 14:06:26.979719"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:06:26.985574"], ["updated_at", "2020-12-22 14:06:26.985574"], ["provider", "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.8ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.3ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.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", "example3.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:06:27.006595"], ["updated_at", "2020-12-22 14:06:27.006595"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.013532"], ["updated_at", "2020-12-22 14:06:27.013532"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 14:06:27.018756"], ["updated_at", "2020-12-22 14:06:27.018756"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.024414"], ["updated_at", "2020-12-22 14:06:27.024414"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 14:06:27.030660"], ["updated_at", "2020-12-22 14:06:27.030660"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.035722"], ["updated_at", "2020-12-22 14:06:27.035722"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.043098"], ["updated_at", "2020-12-22 14:06:27.043098"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.046535"], ["updated_at", "2020-12-22 14:06:27.046535"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) 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", 1846], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:06:27.052009"], ["id", 1846]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.062810"], ["updated_at", "2020-12-22 14:06:27.062810"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.065746"], ["updated_at", "2020-12-22 14:06:27.065746"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) 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]]  (2.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1848], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 14:06:27.082416"], ["id", 1848]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1848], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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]] SQL (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", "2020-12-22 14:06:27.090607"], ["updated_at", "2020-12-22 14:06:27.090607"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.093914"], ["updated_at", "2020-12-22 14:06:27.093914"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1850], ["host", "example.test"], ["LIMIT", 1]] SQL (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", "2020-12-22 14:06:27.097703"], ["id", 1850]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1850], ["LIMIT", 1]]  (3.9ms) ROLLBACK  (0.1ms) BEGIN  (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.111656"], ["updated_at", "2020-12-22 14:06:27.111656"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.114719"], ["updated_at", "2020-12-22 14:06:27.114719"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) 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.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:06:27.175391"], ["updated_at", "2020-12-22 14:06:27.175391"], ["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 15ms (ActiveRecord: 1.9ms)  (0.2ms) ROLLBACK  (0.5ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 14:06:27.194174"], ["updated_at", "2020-12-22 14:06:27.194174"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 11ms (ActiveRecord: 2.0ms)  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:06:27.217655"], ["updated_at", "2020-12-22 14:06:27.217655"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 0.8ms)  (0.5ms) SELECT COUNT(*) FROM "accounts" Account Load (0.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 14:06:27.228817"], ["updated_at", "2020-12-22 14:06:27.228817"], ["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.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 7ms (ActiveRecord: 1.3ms)  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (1.3ms) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 27ms (Views: 24.3ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (1.3ms) 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)  (0.8ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:06:27.294069"], ["updated_at", "2020-12-22 14:06:27.294069"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (8.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:27.316145"], ["updated_at", "2020-12-22 14:06:27.316145"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:06:27.319031"], ["updated_at", "2020-12-22 14:06:27.319031"], ["synced_id", 123], ["host", "test.host"]]  (0.5ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.345146"], ["updated_at", "2020-12-22 14:06:27.345146"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) 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]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.383441"], ["updated_at", "2020-12-22 14:06:27.383441"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.424049"], ["updated_at", "2020-12-22 14:06:27.424049"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) 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 (3.5ms) 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.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (1.1ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.451839"], ["updated_at", "2020-12-22 14:06:27.451839"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.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 (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) 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 (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.476879"], ["updated_at", "2020-12-22 14:06:27.476879"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) 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.3ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:06:27.551606"], ["updated_at", "2020-12-22 14:06:27.551606"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.2ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.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 9ms (Views: 7.8ms | ActiveRecord: 0.0ms)  (0.4ms) ROLLBACK  (0.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)  (0.1ms) ROLLBACK  (0.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 8ms (Views: 7.4ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (7.4ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (2.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] SQL (5.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:07:11.766370"], ["updated_at", "2020-12-22 14:07:11.766370"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:07:11.778690"], ["updated_at", "2020-12-22 14:07:11.778690"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:07:11.784127"], ["updated_at", "2020-12-22 14:07:11.784127"], ["synced_id", 3]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (3.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) 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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:07:11.819534"], ["updated_at", "2020-12-22 14:07:11.819534"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:07:11.845654"], ["updated_at", "2020-12-22 14:07:11.845654"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (6.6ms) BEGIN  (12.7ms) 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]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:07:11.945991"], ["updated_at", "2020-12-22 14:07:11.945991"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) 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]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:07:12.046611"], ["updated_at", "2020-12-22 14:07:12.046611"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (3.8ms) ROLLBACK  (0.5ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:07:12.142359"], ["updated_at", "2020-12-22 14:07:12.142359"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 14:07:12.154002"], ["updated_at", "2020-12-22 14:07:12.154002"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608732432"]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:07:12.165102"], ["updated_at", "2020-12-22 14:07:12.165102"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559632"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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", 1940], ["LIMIT", 1]] SQL (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 14:07:12.203758"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1940]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:07:12.213518"], ["updated_at", "2020-12-22 14:07:12.213518"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559632"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (9.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (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", "2020-12-22 14:07:12.231817"], ["updated_at", "2020-12-22 14:07:12.231817"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559632"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1942], ["LIMIT", 1]] SQL (0.5ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 14:07:12.283849"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1942]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.0ms) ROLLBACK  (2.7ms) BEGIN  (0.1ms) 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]] SQL (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.302081"], ["updated_at", "2020-12-22 14:07:12.302081"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.4ms) 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.2ms) 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]] SQL (0.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", "2020-12-22 14:07:12.316662"], ["updated_at", "2020-12-22 14:07:12.316662"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.323989"], ["updated_at", "2020-12-22 14:07:12.323989"], ["provider", "bookingsync"], ["synced_id", 456]]  (3.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.2ms) 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]] SQL (0.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", "2020-12-22 14:07:12.333763"], ["updated_at", "2020-12-22 14:07:12.333763"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.343856"], ["updated_at", "2020-12-22 14:07:12.343856"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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]]  (10.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]] SQL (4.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", "2020-12-22 14:07:12.379051"], ["updated_at", "2020-12-22 14:07:12.379051"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (15.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) ROLLBACK  (0.2ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (3.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.418399"], ["updated_at", "2020-12-22 14:07:12.418399"], ["provider", "bookingsync"], ["synced_id", 456]]  (5.1ms) RELEASE SAVEPOINT active_record_1 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]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:07:12.434746"], ["updated_at", "2020-12-22 14:07:12.434746"], ["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.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.443435"], ["updated_at", "2020-12-22 14:07:12.443435"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.447642"], ["updated_at", "2020-12-22 14:07:12.447642"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1952], ["LIMIT", 1]] SQL (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", "2020-12-22 14:07:12.451924"], ["id", 1952]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (5.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1952], ["LIMIT", 1]]  (1.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.477468"], ["updated_at", "2020-12-22 14:07:12.477468"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.481487"], ["updated_at", "2020-12-22 14:07:12.481487"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1954], ["LIMIT", 1]] SQL (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", "2020-12-22 14:07:12.492382"], ["id", 1954]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1954], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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]] SQL (5.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.502313"], ["updated_at", "2020-12-22 14:07:12.502313"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.513491"], ["updated_at", "2020-12-22 14:07:12.513491"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND ("accounts"."id" != $2) LIMIT $3 [["synced_id", 123], ["id", 1956], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:07:12.518089"], ["id", 1956]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (4.1ms) ROLLBACK  (0.7ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.533634"], ["updated_at", "2020-12-22 14:07:12.533634"], ["provider", "bookingsync"], ["synced_id", 456]]  (3.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:12.540381"], ["updated_at", "2020-12-22 14:07:12.540381"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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", 1958], ["LIMIT", 1]] SQL (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", "2020-12-22 14:07:12.546219"], ["id", 1958]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN Account Load (10.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 14:07:12.607502"], ["updated_at", "2020-12-22 14:07:12.607502"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 14:07:12.609145"], ["synced_id", 0], ["id", 1959]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (2.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]] SQL (0.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", "2020-12-22 14:07:12.643431"], ["updated_at", "2020-12-22 14:07:12.643431"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] SQL (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", "2020-12-22 14:07:12.656152"], ["updated_at", "2020-12-22 14:07:12.656152"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1961], ["LIMIT", 1]]  (1.0ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND ("accounts"."id" != $1) LIMIT $2 [["id", 1961], ["LIMIT", 1]] SQL (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", "2020-12-22 14:07:12.668829"], ["id", 1961]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1961], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (1.1ms) BEGIN  (0.3ms) ROLLBACK  (6.5ms) BEGIN  (0.2ms) ROLLBACK  (7.6ms) BEGIN  (0.2ms) ROLLBACK  (0.7ms) BEGIN  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (2.9ms) ROLLBACK  (3.5ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.5ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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]] SQL (0.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", "2020-12-22 14:07:12.780261"], ["updated_at", "2020-12-22 14:07:12.780261"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 9ms (ActiveRecord: 2.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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]] SQL (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", "2020-12-22 14:07:12.802370"], ["updated_at", "2020-12-22 14:07:12.802370"], ["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: 4.1ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (13.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} 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", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:07:12.866596"], ["updated_at", "2020-12-22 14:07:12.866596"], ["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.3ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 38ms (ActiveRecord: 7.3ms)  (7.6ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (6.9ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:07:12.906804"], ["updated_at", "2020-12-22 14:07:12.906804"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 1.5ms)  (0.6ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 25ms (Views: 22.2ms | ActiveRecord: 0.0ms)  (0.6ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (0.3ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 11ms (Views: 10.8ms | ActiveRecord: 0.0ms)  (0.7ms) ROLLBACK  (0.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 1ms (ActiveRecord: 0.0ms)  (0.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 11ms (Views: 10.9ms | ActiveRecord: 0.0ms)  (0.8ms) ROLLBACK  (0.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)  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (4.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.016568"], ["updated_at", "2020-12-22 14:07:13.016568"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) 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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.035675"], ["updated_at", "2020-12-22 14:07:13.035675"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (1.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:13.047231"], ["updated_at", "2020-12-22 14:07:13.047231"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.052385"], ["updated_at", "2020-12-22 14:07:13.052385"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (6.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 14:07:13.118656"], ["updated_at", "2020-12-22 14:07:13.118656"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 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", "test.example"], ["LIMIT", 1]] SQL (2.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:13.135730"], ["updated_at", "2020-12-22 14:07:13.135730"], ["synced_id", 123], ["host", "test.example"]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) 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]] SQL (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.150309"], ["updated_at", "2020-12-22 14:07:13.150309"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (22.5ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 Application Exists (67.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.5ms) 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]] SQL (0.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.250095"], ["updated_at", "2020-12-22 14:07:13.250095"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) 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.2ms) ROLLBACK  (0.9ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:13.275341"], ["updated_at", "2020-12-22 14:07:13.275341"], ["synced_id", 1], ["host", "example.test"]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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]] SQL (1.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:13.283808"], ["updated_at", "2020-12-22 14:07:13.283808"], ["synced_id", 2], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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", 1], ["host", "example2.test"], ["LIMIT", 1]] SQL (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:13.299422"], ["updated_at", "2020-12-22 14:07:13.299422"], ["synced_id", 1], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:13.306939"], ["updated_at", "2020-12-22 14:07:13.306939"], ["synced_id", 2], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:07:13.318135"], ["updated_at", "2020-12-22 14:07:13.318135"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.332313"], ["updated_at", "2020-12-22 14:07:13.332313"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.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]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 14:07:13.345432"], ["updated_at", "2020-12-22 14:07:13.345432"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 14:07:13.403972"], ["updated_at", "2020-12-22 14:07:13.403972"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (4.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:07:13.412752"], ["updated_at", "2020-12-22 14:07:13.412752"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (9.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.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]] SQL (0.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", "2020-12-22 14:07:13.433573"], ["updated_at", "2020-12-22 14:07:13.433573"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:07:13.438799"], ["updated_at", "2020-12-22 14:07:13.438799"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 14:07:13.449714"], ["updated_at", "2020-12-22 14:07:13.449714"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.456983"], ["updated_at", "2020-12-22 14:07:13.456983"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.465362"], ["updated_at", "2020-12-22 14:07:13.465362"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:07:13.472081"], ["updated_at", "2020-12-22 14:07:13.472081"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1874], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:07:13.478662"], ["id", 1874]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (16.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.485334"], ["updated_at", "2020-12-22 14:07:13.485334"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (1.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", 456], ["host", "example2.test"], ["LIMIT", 1]] SQL (16.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.515733"], ["updated_at", "2020-12-22 14:07:13.515733"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.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"."id" != $2) AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 1876], ["host", "example.test"], ["LIMIT", 1]] SQL (3.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", "2020-12-22 14:07:13.538700"], ["id", 1876]]  (0.6ms) 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", 1876], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (8.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]] SQL (10.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.561025"], ["updated_at", "2020-12-22 14:07:13.561025"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:07:13.576656"], ["updated_at", "2020-12-22 14:07:13.576656"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1878], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:07:13.584006"], ["id", 1878]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (7.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1878], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.6ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.606583"], ["updated_at", "2020-12-22 14:07:13.606583"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:07:13.609499"], ["updated_at", "2020-12-22 14:07:13.609499"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.616419"], ["updated_at", "2020-12-22 14:07:13.616419"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) 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.5ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" 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.tesu"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.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", "2020-12-22 14:07:13.649127"], ["updated_at", "2020-12-22 14:07:13.649127"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1883], ["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" IS NULL AND ("multi_applications_accounts"."id" != $1) AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 1883], ["host", "example.test"], ["LIMIT", 1]] SQL (0.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", "2020-12-22 14:07:13.664224"], ["id", 1883]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1883], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:13.674855"], ["updated_at", "2020-12-22 14:07:13.674855"], ["synced_id", 123], ["host", "test.example"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.682596"], ["updated_at", "2020-12-22 14:07:13.682596"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) 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.4ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) 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]] SQL (0.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", "2020-12-22 14:07:13.703137"], ["updated_at", "2020-12-22 14:07:13.703137"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608732433"], ["host", "example.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.712314"], ["updated_at", "2020-12-22 14:07:13.712314"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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]] SQL (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", "2020-12-22 14:07:13.723695"], ["updated_at", "2020-12-22 14:07:13.723695"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559633"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (2.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] SQL (0.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.735999"], ["updated_at", "2020-12-22 14:07:13.735999"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1886], ["host", "example.test"], ["LIMIT", 1]] SQL (5.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", "2020-12-22 14:07:13.784929"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1886]]  (6.5ms) RELEASE SAVEPOINT active_record_1  (3.1ms) ROLLBACK  (1.0ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (19.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.815639"], ["updated_at", "2020-12-22 14:07:13.815639"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (9.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.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.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.874059"], ["updated_at", "2020-12-22 14:07:13.874059"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.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 (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 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 (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.917616"], ["updated_at", "2020-12-22 14:07:13.917616"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.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 (0.4ms) 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.4ms) 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.3ms) ROLLBACK  (0.2ms) BEGIN  (0.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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.949331"], ["updated_at", "2020-12-22 14:07:13.949331"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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 (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.5ms) 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]] SQL (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:13.975856"], ["updated_at", "2020-12-22 14:07:13.975856"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) 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.1ms) BEGIN  (0.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 (3.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:07:14.004554"], ["updated_at", "2020-12-22 14:07:14.004554"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] SQL (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:07:14.044116"], ["updated_at", "2020-12-22 14:07:14.044116"], ["synced_id", 123]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) 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", "example.host"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:14.061777"], ["updated_at", "2020-12-22 14:07:14.061777"], ["synced_id", 123], ["host", "example.host"]]  (0.3ms) 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", 123], ["host", "test.host"], ["LIMIT", 1]] SQL (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:07:14.068049"], ["updated_at", "2020-12-22 14:07:14.068049"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) 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 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.9ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (1.0ms) ROLLBACK  (0.9ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (4.1ms) 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 (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", "2020-12-22 14:08:04.482678"], ["updated_at", "2020-12-22 14:08:04.482678"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 254ms (ActiveRecord: 53.2ms)  (0.8ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.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", "2020-12-22 14:08:05.633418"], ["updated_at", "2020-12-22 14:08:05.633418"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 12ms (ActiveRecord: 2.9ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.9ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:05.692415"], ["updated_at", "2020-12-22 14:08:05.692415"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.5ms)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (2.5ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (1.3ms) ROLLBACK  (0.2ms) BEGIN  (25.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) 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.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", "2020-12-22 14:08:05.773360"], ["updated_at", "2020-12-22 14:08:05.773360"], ["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.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 26ms (ActiveRecord: 7.1ms)  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (1.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 28ms (Views: 20.9ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.7ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/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 3ms (Views: 1.5ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 1ms (ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 0ms (ActiveRecord: 0.0ms)  (1.1ms) ROLLBACK  (0.3ms) BEGIN  (1.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:06.144020"], ["updated_at", "2020-12-22 14:08:06.144020"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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", "2020-12-22 14:08:06.147039"], ["updated_at", "2020-12-22 14:08:06.147039"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) 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", 1970], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 14:08:06.151777"], ["id", 1970]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:06.157380"], ["updated_at", "2020-12-22 14:08:06.157380"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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", "2020-12-22 14:08:06.160488"], ["updated_at", "2020-12-22 14:08:06.160488"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) 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 (4.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1972], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 14:08:06.177635"], ["id", 1972]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:06.185191"], ["updated_at", "2020-12-22 14:08:06.185191"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists (4.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:06.192139"], ["updated_at", "2020-12-22 14:08:06.192139"], ["provider", "bookingsync"], ["synced_id", 123]]  (1.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1974], ["LIMIT", 1]] Account Update (6.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", "2020-12-22 14:08:06.204497"], ["id", 1974]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1974], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:06.217548"], ["updated_at", "2020-12-22 14:08:06.217548"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:06.222930"], ["updated_at", "2020-12-22 14:08:06.222930"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1976], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 14:08:06.226798"], ["id", 1976]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1976], ["LIMIT", 1]]  (1.0ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:06.234149"], ["updated_at", "2020-12-22 14:08:06.234149"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "accounts" 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]]  (0.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 (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", "2020-12-22 14:08:06.245628"], ["updated_at", "2020-12-22 14:08:06.245628"], ["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.3ms) SELECT COUNT(*) FROM "accounts"  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.5ms) 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 (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:06.257777"], ["updated_at", "2020-12-22 14:08:06.257777"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (11.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) 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.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", "2020-12-22 14:08:06.285421"], ["updated_at", "2020-12-22 14:08:06.285421"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:06.293051"], ["updated_at", "2020-12-22 14:08:06.293051"], ["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.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 (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", "2020-12-22 14:08:06.303335"], ["updated_at", "2020-12-22 14:08:06.303335"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:06.310920"], ["updated_at", "2020-12-22 14:08:06.310920"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) 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", "2020-12-22 14:08:06.317273"], ["updated_at", "2020-12-22 14:08:06.317273"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.1ms) 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 (22.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", "2020-12-22 14:08:06.326752"], ["updated_at", "2020-12-22 14:08:06.326752"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (7.5ms) ROLLBACK  (1.5ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.3ms) 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", "2020-12-22 14:08:06.380691"], ["updated_at", "2020-12-22 14:08:06.380691"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Account Exists (0.4ms) 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", "2020-12-22 14:08:06.384909"], ["updated_at", "2020-12-22 14:08:06.384909"], ["synced_id", 2]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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 (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:06.390860"], ["updated_at", "2020-12-22 14:08:06.390860"], ["synced_id", 3]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.1ms) 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 (0.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", "2020-12-22 14:08:06.403072"], ["updated_at", "2020-12-22 14:08:06.403072"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (6.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1989], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists (7.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1989], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 14:08:06.423329"], ["id", 1989]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (4.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1989], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.3ms) BEGIN  (0.2ms) 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 (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:06.440367"], ["updated_at", "2020-12-22 14:08:06.440367"], ["synced_id", 123]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:06.517825"], ["updated_at", "2020-12-22 14:08:06.517825"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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", "2020-12-22 14:08:06.535648"], ["updated_at", "2020-12-22 14:08:06.535648"], ["synced_id", 123]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.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", "2020-12-22 14:08:06.568221"], ["updated_at", "2020-12-22 14:08:06.568221"], ["synced_id", 123]]  (3.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.7ms) BEGIN  (0.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 (6.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", "2020-12-22 14:08:06.616860"], ["updated_at", "2020-12-22 14:08:06.616860"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559686"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1994], ["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", "2020-12-22 14:08:06.684342"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1994]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists (0.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", "2020-12-22 14:08:06.700388"], ["updated_at", "2020-12-22 14:08:06.700388"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559686"]]  (3.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (1.2ms) SAVEPOINT active_record_1 Account Exists (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:06.716051"], ["updated_at", "2020-12-22 14:08:06.716051"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559686"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 1996], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 14:08:06.767641"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1996]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:06.779451"], ["updated_at", "2020-12-22 14:08:06.779451"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608732486"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.1ms) BEGIN Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.7ms) SAVEPOINT active_record_1 Account Create (0.6ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 14:08:06.802730"], ["updated_at", "2020-12-22 14:08:06.802730"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Update (1.0ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 14:08:06.809843"], ["synced_id", 0], ["id", 1998]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Exists (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:06.835312"], ["updated_at", "2020-12-22 14:08:06.835312"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (5.2ms) 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.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", "2020-12-22 14:08:06.895695"], ["updated_at", "2020-12-22 14:08:06.895695"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) 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.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", "2020-12-22 14:08:06.929396"], ["updated_at", "2020-12-22 14:08:06.929396"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (6.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:06.950822"], ["updated_at", "2020-12-22 14:08:06.950822"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:06.965149"], ["updated_at", "2020-12-22 14:08:06.965149"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.3ms) 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 (4.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.3ms) ROLLBACK  (0.3ms) BEGIN  (0.8ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) 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.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.004156"], ["updated_at", "2020-12-22 14:08:07.004156"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.018433"], ["updated_at", "2020-12-22 14:08:07.018433"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.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 (0.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists (0.4ms) 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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (5.7ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.5ms) BEGIN  (0.1ms) ROLLBACK  (0.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 13ms (Views: 11.4ms | ActiveRecord: 0.0ms)  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (0.3ms) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 1ms (Views: 0.9ms | ActiveRecord: 0.0ms)  (0.1ms) ROLLBACK  (0.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)  (0.5ms) ROLLBACK  (0.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 6ms (Views: 4.8ms | ActiveRecord: 0.0ms)  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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 (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:07.125100"], ["updated_at", "2020-12-22 14:08:07.125100"], ["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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.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.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", "2020-12-22 14:08:07.146933"], ["updated_at", "2020-12-22 14:08:07.146933"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:07.149895"], ["updated_at", "2020-12-22 14:08:07.149895"], ["synced_id", 123], ["host", "test.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) ROLLBACK  (0.9ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.177867"], ["updated_at", "2020-12-22 14:08:07.177867"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (3.0ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (1.5ms) BEGIN  (0.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", "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", "2020-12-22 14:08:07.199994"], ["updated_at", "2020-12-22 14:08:07.199994"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.209722"], ["updated_at", "2020-12-22 14:08:07.209722"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 14:08:07.213620"], ["updated_at", "2020-12-22 14:08:07.213620"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.2ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 14:08:07.219733"], ["updated_at", "2020-12-22 14:08:07.219733"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.224909"], ["updated_at", "2020-12-22 14:08:07.224909"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) 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", "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", "2020-12-22 14:08:07.240055"], ["updated_at", "2020-12-22 14:08:07.240055"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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", "2020-12-22 14:08:07.246059"], ["updated_at", "2020-12-22 14:08:07.246059"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 14:08:07.253115"], ["updated_at", "2020-12-22 14:08:07.253115"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.264494"], ["updated_at", "2020-12-22 14:08:07.264494"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.270365"], ["updated_at", "2020-12-22 14:08:07.270365"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.276617"], ["updated_at", "2020-12-22 14:08:07.276617"], ["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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1901], ["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", "2020-12-22 14:08:07.283488"], ["id", 1901]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) 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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.292299"], ["updated_at", "2020-12-22 14:08:07.292299"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.297505"], ["updated_at", "2020-12-22 14:08:07.297505"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1903], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 14:08:07.302564"], ["id", 1903]]  (1.4ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.2ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1903], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.311257"], ["updated_at", "2020-12-22 14:08:07.311257"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.313781"], ["updated_at", "2020-12-22 14:08:07.313781"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1905], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 14:08:07.317698"], ["id", 1905]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1905], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.335602"], ["updated_at", "2020-12-22 14:08:07.335602"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.345424"], ["updated_at", "2020-12-22 14:08:07.345424"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:07.350439"], ["updated_at", "2020-12-22 14:08:07.350439"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.4ms) 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 (1.5ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.360176"], ["updated_at", "2020-12-22 14:08:07.360176"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.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", "2020-12-22 14:08:07.476290"], ["updated_at", "2020-12-22 14:08:07.476290"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1910], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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", 1910], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.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", "2020-12-22 14:08:07.482035"], ["id", 1910]]  (0.6ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1910], ["LIMIT", 1]]  (0.8ms) ROLLBACK  (0.1ms) BEGIN  (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:07.493669"], ["updated_at", "2020-12-22 14:08:07.493669"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.498301"], ["updated_at", "2020-12-22 14:08:07.498301"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) 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.2ms) ROLLBACK  (0.3ms) BEGIN  (0.9ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (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", "2020-12-22 14:08:07.510135"], ["updated_at", "2020-12-22 14:08:07.510135"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.6ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.516696"], ["updated_at", "2020-12-22 14:08:07.516696"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists (0.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.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" MultiApplicationsAccount Exists (0.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.4ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) 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", 1], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:07.538824"], ["updated_at", "2020-12-22 14:08:07.538824"], ["synced_id", 1], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:07.546547"], ["updated_at", "2020-12-22 14:08:07.546547"], ["synced_id", 2], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:07.549149"], ["updated_at", "2020-12-22 14:08:07.549149"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:07.551281"], ["updated_at", "2020-12-22 14:08:07.551281"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (0.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", "2020-12-22 14:08:07.557173"], ["updated_at", "2020-12-22 14:08:07.557173"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608732487"], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.564542"], ["updated_at", "2020-12-22 14:08:07.564542"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists (0.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 (5.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", "2020-12-22 14:08:07.569990"], ["updated_at", "2020-12-22 14:08:07.569990"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559687"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.582938"], ["updated_at", "2020-12-22 14:08:07.582938"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) 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.2ms) 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", 1919], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.3ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 14:08:07.626257"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1919]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:07.633799"], ["updated_at", "2020-12-22 14:08:07.633799"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (5.1ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.645653"], ["updated_at", "2020-12-22 14:08:07.645653"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] Application Create (0.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.651673"], ["updated_at", "2020-12-22 14:08:07.651673"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:07.661516"], ["updated_at", "2020-12-22 14:08:07.661516"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (5.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.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:45.694347"], ["updated_at", "2020-12-22 14:08:45.694347"], ["synced_id", 123], ["host", "example.host"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:45.699319"], ["updated_at", "2020-12-22 14:08:45.699319"], ["synced_id", 123], ["host", "test.host"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (7.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", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:45.852207"], ["updated_at", "2020-12-22 14:08:45.852207"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 2.9ms | Allocations: 264) Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. Completed 200 OK in 41ms (Views: 23.6ms | ActiveRecord: 0.0ms | Allocations: 3195)  (0.2ms) ROLLBACK  (0.3ms) BEGIN Processing by SessionsController#failure as HTML Rendering /Users/zolw/Documents/Coding/bookingsync/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/zolw/Documents/Coding/bookingsync/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (Duration: 0.2ms | Allocations: 54) 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 | Allocations: 426)  (0.4ms) ROLLBACK  (0.2ms) 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]]  (0.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 (0.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", "2020-12-22 14:08:45.950282"], ["updated_at", "2020-12-22 14:08:45.950282"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 21ms (ActiveRecord: 6.2ms | Allocations: 935)  (0.3ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:45.960982"], ["updated_at", "2020-12-22 14:08:45.960982"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/admin Completed 302 Found in 5ms (ActiveRecord: 1.2ms | Allocations: 874)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.7ms) SELECT COUNT(*) FROM "multi_applications_accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 14:08:45.995709"], ["updated_at", "2020-12-22 14:08:45.995709"], ["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.2ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 8ms (ActiveRecord: 1.8ms | Allocations: 976)  (0.3ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (2.5ms) 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.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SELECT COUNT(*) FROM "accounts" Processing by SessionsController#create as HTML Parameters: {"provider"=>"bookingsync"} Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:46.018180"], ["updated_at", "2020-12-22 14:08:46.018180"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Redirected to http://test.host/ Completed 302 Found in 5ms (ActiveRecord: 1.2ms | Allocations: 882)  (0.3ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/signed_out Completed 302 Found in 0ms (ActiveRecord: 0.0ms | Allocations: 119)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by SessionsController#destroy as HTML Redirected to http://test.host/ Completed 302 Found in 1ms (ActiveRecord: 0.0ms | Allocations: 118)  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Application Exists? (4.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.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", "2020-12-22 14:08:46.064069"], ["updated_at", "2020-12-22 14:08:46.064069"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.4ms) 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? (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (1.8ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:46.108940"], ["updated_at", "2020-12-22 14:08:46.108940"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.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? (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:46.123316"], ["updated_at", "2020-12-22 14:08:46.123316"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (13.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.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? (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.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:46.155518"], ["updated_at", "2020-12-22 14:08:46.155518"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.7ms) RELEASE SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.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]] 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", "2020-12-22 14:08:46.169541"], ["updated_at", "2020-12-22 14:08:46.169541"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] Application Exists? (0.3ms) 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.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.5ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) 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.3ms) 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", "2020-12-22 14:08:46.197997"], ["updated_at", "2020-12-22 14:08:46.197997"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]]  (9.7ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["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? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as HTML Rendering html template Rendered html template (Duration: 0.0ms | Allocations: 3) Filter chain halted as :authenticate_account! rendered or redirected Completed 200 OK in 20ms (Views: 19.8ms | ActiveRecord: 0.0ms | Allocations: 571)  (2.0ms) ROLLBACK  (0.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 | Allocations: 94)  (0.3ms) ROLLBACK  (0.1ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 17ms (Views: 17.0ms | ActiveRecord: 0.0ms | Allocations: 350)  (0.2ms) ROLLBACK  (0.2ms) BEGIN Processing by AuthenticatedController#index as JS Rendering text template Rendered text template (Duration: 0.0ms | Allocations: 1) Filter chain halted as :authenticate_account! rendered or redirected Completed 401 Unauthorized in 3ms (Views: 0.7ms | ActiveRecord: 0.0ms | Allocations: 165)  (0.3ms) ROLLBACK  (0.6ms) BEGIN Account Load (16.4ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2020-12-22 14:08:46.319192"], ["updated_at", "2020-12-22 14:08:46.319192"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2020-12-22 14:08:46.327587"], ["synced_id", 0], ["id", 2005]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Exists? (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:46.363212"], ["updated_at", "2020-12-22 14:08:46.363212"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.2ms) BEGIN  (0.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 (0.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:46.382745"], ["updated_at", "2020-12-22 14:08:46.382745"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (2.8ms) BEGIN  (0.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 (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:46.492861"], ["updated_at", "2020-12-22 14:08:46.492861"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:46.510651"], ["updated_at", "2020-12-22 14:08:46.510651"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:46.552360"], ["updated_at", "2020-12-22 14:08:46.552360"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.0ms) SELECT COUNT(*) FROM "accounts" Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:46.559411"], ["updated_at", "2020-12-22 14:08:46.559411"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "accounts"  (0.1ms) ROLLBACK  (0.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 (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:46.650267"], ["updated_at", "2020-12-22 14:08:46.650267"], ["provider", "bookingsync"], ["synced_id", 456]]  (2.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.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:46.659685"], ["updated_at", "2020-12-22 14:08:46.659685"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists? (0.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", "2020-12-22 14:08:46.675378"], ["updated_at", "2020-12-22 14:08:46.675378"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.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]]  (0.6ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:46.684226"], ["updated_at", "2020-12-22 14:08:46.684226"], ["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.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) 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", "2020-12-22 14:08:46.690701"], ["updated_at", "2020-12-22 14:08:46.690701"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:46.695595"], ["updated_at", "2020-12-22 14:08:46.695595"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:46.700961"], ["updated_at", "2020-12-22 14:08:46.700961"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) 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") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:46.704026"], ["updated_at", "2020-12-22 14:08:46.704026"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.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? (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2019], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 14:08:46.712535"], ["id", 2019]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:46.717402"], ["updated_at", "2020-12-22 14:08:46.717402"], ["provider", "bookingsync"], ["synced_id", 456]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:46.723821"], ["updated_at", "2020-12-22 14:08:46.723821"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]]  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2021], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 14:08:46.728691"], ["id", 2021]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (2.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 2021], ["LIMIT", 1]]  (21.3ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 Account Exists? (0.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", "2020-12-22 14:08:46.763020"], ["updated_at", "2020-12-22 14:08:46.763020"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.8ms) RELEASE SAVEPOINT active_record_1  (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 (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:46.773876"], ["updated_at", "2020-12-22 14:08:46.773876"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.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.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2023], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 14:08:46.779242"], ["id", 2023]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 2023], ["LIMIT", 1]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.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.5ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:46.791855"], ["updated_at", "2020-12-22 14:08:46.791855"], ["provider", "bookingsync"], ["synced_id", 456]]  (1.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", 123], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:46.797435"], ["updated_at", "2020-12-22 14:08:46.797435"], ["provider", "bookingsync"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) 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.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2025], ["LIMIT", 1]] Account Update (0.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", "2020-12-22 14:08:46.802584"], ["id", 2025]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) ROLLBACK  (0.9ms) BEGIN  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] Account Create (0.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:46.861791"], ["updated_at", "2020-12-22 14:08:46.861791"], ["synced_id", 1]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) 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 (2.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:46.880041"], ["updated_at", "2020-12-22 14:08:46.880041"], ["synced_id", 2]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) 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.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:46.885288"], ["updated_at", "2020-12-22 14:08:46.885288"], ["synced_id", 3]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (1.7ms) SAVEPOINT active_record_1 Account Exists? (0.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", "2020-12-22 14:08:46.900315"], ["updated_at", "2020-12-22 14:08:46.900315"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559726"]]  (2.8ms) 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 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2029], ["LIMIT", 1]] Account Update (0.3ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 14:08:46.968318"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 2029]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:46.985161"], ["updated_at", "2020-12-22 14:08:46.985161"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559726"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2030], ["LIMIT", 1]] Account Update (0.4ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2020-12-22 14:08:47.020139"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 2030]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.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", "2020-12-22 14:08:47.027999"], ["updated_at", "2020-12-22 14:08:47.027999"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559727"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:47.043930"], ["updated_at", "2020-12-22 14:08:47.043930"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608732527"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:47.048860"], ["updated_at", "2020-12-22 14:08:47.048860"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 2033], ["LIMIT", 1]]  (1.5ms) 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", 2033], ["LIMIT", 1]] Account Update (0.5ms) 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", "2020-12-22 14:08:47.067646"], ["id", 2033]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 2033], ["LIMIT", 1]]  (0.9ms) ROLLBACK  (0.4ms) BEGIN  (0.4ms) SAVEPOINT active_record_1 Account Exists? (0.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] Account Create (10.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2020-12-22 14:08:47.094845"], ["updated_at", "2020-12-22 14:08:47.094845"], ["synced_id", 123]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 Account Exists? (0.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] Account Create (0.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", "2020-12-22 14:08:47.113398"], ["updated_at", "2020-12-22 14:08:47.113398"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.120029"], ["updated_at", "2020-12-22 14:08:47.120029"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Application Load (0.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.7ms) BEGIN  (0.2ms) ROLLBACK  (1.8ms) BEGIN  (0.2ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) ROLLBACK  (2.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) ROLLBACK  (0.1ms) BEGIN  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 14:08:47.160614"], ["updated_at", "2020-12-22 14:08:47.160614"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608559727"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Application Exists? (3.9ms) 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? (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["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", "2020-12-22 14:08:47.174750"], ["updated_at", "2020-12-22 14:08:47.174750"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]]  (0.5ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1924], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (0.4ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2020-12-22 14:08:47.213927"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 1924]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (4.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 (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", "2020-12-22 14:08:47.224167"], ["updated_at", "2020-12-22 14:08:47.224167"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1608732527"], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] Application Exists? (0.3ms) 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 (4.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.233723"], ["updated_at", "2020-12-22 14:08:47.233723"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) 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.2ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Create (0.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.258127"], ["updated_at", "2020-12-22 14:08:47.258127"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.261037"], ["updated_at", "2020-12-22 14:08:47.261037"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" MultiApplicationsAccount Load (8.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.3ms) 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.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", "2020-12-22 14:08:47.281742"], ["updated_at", "2020-12-22 14:08:47.281742"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "multi_applications_accounts"  (0.3ms) ROLLBACK  (0.3ms) 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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 14:08:47.293793"], ["updated_at", "2020-12-22 14:08:47.293793"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (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", "2020-12-22 14:08:47.297174"], ["updated_at", "2020-12-22 14:08:47.297174"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 14:08:47.305101"], ["updated_at", "2020-12-22 14:08:47.305101"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.313677"], ["updated_at", "2020-12-22 14:08:47.313677"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN MultiApplicationsAccount Load (0.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.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.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", "2020-12-22 14:08:47.318219"], ["updated_at", "2020-12-22 14:08:47.318219"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (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", "2020-12-22 14:08:47.324469"], ["updated_at", "2020-12-22 14:08:47.324469"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.330539"], ["updated_at", "2020-12-22 14:08:47.330539"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (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", "2020-12-22 14:08:47.347314"], ["updated_at", "2020-12-22 14:08:47.347314"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.7ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 1935], ["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", "2020-12-22 14:08:47.352871"], ["id", 1935]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.4ms) BEGIN  (0.1ms) 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 (5.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.433284"], ["updated_at", "2020-12-22 14:08:47.433284"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.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", 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", "2020-12-22 14:08:47.450895"], ["updated_at", "2020-12-22 14:08:47.450895"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.6ms) 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", 1937], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (12.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", "2020-12-22 14:08:47.496532"], ["id", 1937]]  (0.7ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1937], ["LIMIT", 1]]  (0.7ms) ROLLBACK  (0.9ms) BEGIN  (2.5ms) 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 (6.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.546796"], ["updated_at", "2020-12-22 14:08:47.546796"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (1.7ms) RELEASE SAVEPOINT active_record_1  (2.0ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (23.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 (6.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.584502"], ["updated_at", "2020-12-22 14:08:47.584502"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (1.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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]]  (4.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (9.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", 1939], ["host", "example.test"], ["LIMIT", 1]] MultiApplicationsAccount Update (2.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", "2020-12-22 14:08:47.610764"], ["id", 1939]]  (2.0ms) 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", 1939], ["LIMIT", 1]]  (3.8ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", "2020-12-22 14:08:47.628230"], ["updated_at", "2020-12-22 14:08:47.628230"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (3.7ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_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", "2020-12-22 14:08:47.644948"], ["updated_at", "2020-12-22 14:08:47.644948"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (3.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:47.653210"], ["updated_at", "2020-12-22 14:08:47.653210"], ["synced_id", 123], ["host", "test.example"]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.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.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.665852"], ["updated_at", "2020-12-22 14:08:47.665852"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) 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.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["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", "2020-12-22 14:08:47.676142"], ["updated_at", "2020-12-22 14:08:47.676142"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Application Load (0.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.4ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:47.686183"], ["updated_at", "2020-12-22 14:08:47.686183"], ["synced_id", 1], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:47.693242"], ["updated_at", "2020-12-22 14:08:47.693242"], ["synced_id", 2], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:47.696247"], ["updated_at", "2020-12-22 14:08:47.696247"], ["synced_id", 1], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:47.700050"], ["updated_at", "2020-12-22 14:08:47.700050"], ["synced_id", 2], ["host", "example2.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.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.1ms) ROLLBACK  (0.7ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", "2020-12-22 14:08:47.710661"], ["updated_at", "2020-12-22 14:08:47.710661"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.3ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] MultiApplicationsAccount Exists? (0.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? (0.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.2ms) ROLLBACK  (0.3ms) BEGIN  (0.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.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", "2020-12-22 14:08:47.730332"], ["updated_at", "2020-12-22 14:08:47.730332"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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 (0.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", "2020-12-22 14:08:47.756532"], ["updated_at", "2020-12-22 14:08:47.756532"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]]  (0.2ms) RELEASE SAVEPOINT active_record_1 MultiApplicationsAccount Load (0.4ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 1950], ["LIMIT", 1]]  (0.4ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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", 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", "2020-12-22 14:08:47.767910"], ["id", 1950]]  (2.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", 1950], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.1ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "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.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:47.779168"], ["updated_at", "2020-12-22 14:08:47.779168"], ["synced_id", 123], ["host", "test.example"]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.784596"], ["updated_at", "2020-12-22 14:08:47.784596"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.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.3ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) 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.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] Application Exists? (0.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] Application Create (0.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.836023"], ["updated_at", "2020-12-22 14:08:47.836023"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Application Load (1.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) SAVEPOINT active_record_1 MultiApplicationsAccount Exists? (0.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.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2020-12-22 14:08:47.847349"], ["updated_at", "2020-12-22 14:08:47.847349"], ["synced_id", 123], ["host", "test.example"]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] Application Exists? (0.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] Application Create (0.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2020-12-22 14:08:47.850878"], ["updated_at", "2020-12-22 14:08:47.850878"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Application Load (0.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (0.2ms) ROLLBACK  (0.1ms) BEGIN  (1.7ms) ROLLBACK  (8.6ms) BEGIN  (0.1ms) ROLLBACK  (0.2ms) BEGIN  (1.2ms) ROLLBACK  (0.1ms) BEGIN  (0.2ms) ROLLBACK  (0.7ms) BEGIN  (5.9ms) ROLLBACK  (0.2ms) BEGIN  (0.4ms) ROLLBACK  (0.4ms) BEGIN  (0.7ms) ROLLBACK  (0.3ms) BEGIN  (0.4ms) ROLLBACK