spec/dummy/log/test.log in bookingsync-engine-4.0.1 vs spec/dummy/log/test.log in bookingsync-engine-4.0.2

- old
+ new

@@ -62521,5 +62521,1313 @@  (1.0ms) RELEASE SAVEPOINT active_record_1 Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]]  (0.8ms) ROLLBACK +  (0.8ms) BEGIN +  (1.4ms) SAVEPOINT active_record_1 + Application Exists (7.7ms) 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 (3.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:01.839588"], ["updated_at", "2019-07-17 03:48:01.839588"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] +  (1.5ms) ROLLBACK +  (0.8ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:01.883912"], ["updated_at", "2019-07-17 03:48:01.883912"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.7ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]] +  (1.1ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:01.914804"], ["updated_at", "2019-07-17 03:48:01.914804"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.8ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] + Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] + Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] +  (1.1ms) ROLLBACK +  (0.9ms) BEGIN +  (1.0ms) SAVEPOINT active_record_1 + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:01.950925"], ["updated_at", "2019-07-17 03:48:01.950925"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (1.0ms) RELEASE SAVEPOINT active_record_1 + Application Load (1.1ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] + Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] + Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] +  (1.0ms) ROLLBACK +  (0.8ms) BEGIN +  (0.8ms) SAVEPOINT active_record_1 + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:01.990305"], ["updated_at", "2019-07-17 03:48:01.990305"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 + Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]] +  (1.0ms) ROLLBACK +  (0.9ms) BEGIN +  (1.0ms) SAVEPOINT active_record_1 + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.016737"], ["updated_at", "2019-07-17 03:48:02.016737"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (1.0ms) RELEASE SAVEPOINT active_record_1 + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]] +  (0.8ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.040757"], ["updated_at", "2019-07-17 03:48:02.040757"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]] +  (1.2ms) ROLLBACK +  (1.0ms) BEGIN +  (1.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 (2.3ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.109079"], ["updated_at", "2019-07-17 03:48:02.109079"], ["synced_id", 123], ["host", "example.host"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.114962"], ["updated_at", "2019-07-17 03:48:02.114962"], ["synced_id", 123], ["host", "test.host"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.9ms) BEGIN +  (1.1ms) SAVEPOINT active_record_1 + Account Exists (4.4ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (2.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:48:02.138267"], ["updated_at", "2019-07-17 03:48:02.138267"], ["synced_id", 123]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.154202"], ["updated_at", "2019-07-17 03:48:02.154202"], ["synced_id", 123], ["host", "test.example"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) SAVEPOINT active_record_1 + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] + Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] + Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] + Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.160003"], ["updated_at", "2019-07-17 03:48:02.160003"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] + Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] + Application Exists (0.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] + Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.165667"], ["updated_at", "2019-07-17 03:48:02.165667"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]] +  (0.5ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.173405"], ["updated_at", "2019-07-17 03:48:02.173405"], ["synced_id", 123], ["host", "test.example"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] + Application Create (1.3ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.180355"], ["updated_at", "2019-07-17 03:48:02.180355"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 + Application Load (1.4ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] +  (1.0ms) ROLLBACK +  (0.6ms) BEGIN +  (0.8ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.209736"], ["updated_at", "2019-07-17 03:48:02.209736"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.213847"], ["updated_at", "2019-07-17 03:48:02.213847"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.222019"], ["updated_at", "2019-07-17 03:48:02.222019"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.226070"], ["updated_at", "2019-07-17 03:48:02.226070"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (3.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" + MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-07-17 03:48:02.239212"], ["updated_at", "2019-07-17 03:48:02.239212"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" +  (0.9ms) ROLLBACK +  (0.9ms) BEGIN + MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-07-17 03:48:02.249697"], ["updated_at", "2019-07-17 03:48:02.249697"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.254600"], ["updated_at", "2019-07-17 03:48:02.254600"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN + MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.8ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.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-07-17 03:48:02.263172"], ["updated_at", "2019-07-17 03:48:02.263172"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]] +  (0.5ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.7ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.266640"], ["updated_at", "2019-07-17 03:48:02.266640"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.5ms) BEGIN + MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.5ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-07-17 03:48:02.274297"], ["updated_at", "2019-07-17 03:48:02.274297"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]] +  (0.5ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.277915"], ["updated_at", "2019-07-17 03:48:02.277915"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (1.1ms) ROLLBACK +  (0.9ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.289381"], ["updated_at", "2019-07-17 03:48:02.289381"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.293804"], ["updated_at", "2019-07-17 03:48:02.293804"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2190], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-07-17 03:48:02.299842"], ["id", 2190]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (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-07-17 03:48:02.307489"], ["updated_at", "2019-07-17 03:48:02.307489"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.312705"], ["updated_at", "2019-07-17 03:48:02.312705"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2192], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-07-17 03:48:02.319099"], ["id", 2192]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2192], ["LIMIT", 1]] +  (0.8ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.329820"], ["updated_at", "2019-07-17 03:48:02.329820"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.334758"], ["updated_at", "2019-07-17 03:48:02.334758"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2194], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-07-17 03:48:02.340815"], ["id", 2194]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2194], ["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.350303"], ["updated_at", "2019-07-17 03:48:02.350303"], ["synced_id", 123], ["host", "test.example"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] + Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] + Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.356535"], ["updated_at", "2019-07-17 03:48:02.356535"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] +  (0.9ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.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-07-17 03:48:02.365976"], ["updated_at", "2019-07-17 03:48:02.365976"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2197], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 2197], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Update (1.1ms) UPDATE "multi_applications_accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "multi_applications_accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-07-17 03:48:02.374031"], ["id", 2197]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2197], ["LIMIT", 1]] +  (0.8ms) ROLLBACK +  (0.8ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.384182"], ["updated_at", "2019-07-17 03:48:02.384182"], ["synced_id", 1], ["host", "example.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.388476"], ["updated_at", "2019-07-17 03:48:02.388476"], ["synced_id", 2], ["host", "example.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.392501"], ["updated_at", "2019-07-17 03:48:02.392501"], ["synced_id", 1], ["host", "example2.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.397098"], ["updated_at", "2019-07-17 03:48:02.397098"], ["synced_id", 2], ["host", "example2.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] + Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] + Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.407583"], ["updated_at", "2019-07-17 03:48:02.407583"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Application Load (2.3ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] +  (1.7ms) ROLLBACK +  (0.8ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-07-17 03:48:02.437899"], ["updated_at", "2019-07-17 03:48:02.437899"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1563248882"], ["host", "example.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] + Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] + Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.443970"], ["updated_at", "2019-07-17 03:48:02.443970"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] +  (2.0ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.5ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2202], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Update (1.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-07-17 03:48:02.462146"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 2202]] +  (1.2ms) RELEASE SAVEPOINT active_record_1 +  (1.4ms) ROLLBACK +  (0.9ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-07-17 03:48:02.472314"], ["updated_at", "2019-07-17 03:48:02.472314"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1563421682"], ["host", "example.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) SAVEPOINT active_record_1 + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "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.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] + Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.479134"], ["updated_at", "2019-07-17 03:48:02.479134"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.6ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] +  (0.6ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-07-17 03:48:02.487399"], ["updated_at", "2019-07-17 03:48:02.487399"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.1ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.495708"], ["updated_at", "2019-07-17 03:48:02.495708"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] + MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]] +  (0.8ms) ROLLBACK +  (0.8ms) BEGIN +  (0.7ms) ROLLBACK +  (1.1ms) BEGIN +  (0.8ms) ROLLBACK +  (0.9ms) BEGIN +  (1.0ms) ROLLBACK +  (0.8ms) BEGIN +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. + Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 7ms (Views: 3.8ms | ActiveRecord: 0.0ms) +  (1.0ms) ROLLBACK +  (0.9ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. + Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms) +  (0.9ms) ROLLBACK +  (0.9ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.8ms) SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-07-17 03:48:02.552027"], ["updated_at", "2019-07-17 03:48:02.552027"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 10ms (ActiveRecord: 5.1ms) +  (1.0ms) ROLLBACK +  (0.7ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-07-17 03:48:02.567729"], ["updated_at", "2019-07-17 03:48:02.567729"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 8ms (ActiveRecord: 4.7ms) +  (0.8ms) ROLLBACK +  (0.6ms) BEGIN +  (1.0ms) SELECT COUNT(*) FROM "multi_applications_accounts" +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (1.3ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.3ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-07-17 03:48:02.582224"], ["updated_at", "2019-07-17 03:48:02.582224"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 8ms (ActiveRecord: 5.5ms) +  (1.2ms) SELECT COUNT(*) FROM "multi_applications_accounts" + MultiApplicationsAccount Load (1.1ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] + MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] +  (1.1ms) ROLLBACK +  (0.9ms) BEGIN +  (1.5ms) SELECT COUNT(*) FROM "accounts" +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.9ms) SAVEPOINT active_record_1 + Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-07-17 03:48:02.603315"], ["updated_at", "2019-07-17 03:48:02.603315"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 8ms (ActiveRecord: 5.1ms) +  (1.0ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] +  (0.8ms) ROLLBACK +  (0.7ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.7ms) ROLLBACK +  (1.1ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN +Processing by AuthenticatedController#index as JS + Rendering text template + Rendered text template (0.0ms) +Filter chain halted as :authenticate_account! rendered or redirected +Completed 401 Unauthorized in 3ms (Views: 2.7ms | ActiveRecord: 0.0ms) +  (1.2ms) ROLLBACK +  (0.8ms) BEGIN +Processing by AuthenticatedController#index as JS + Rendering text template + Rendered text template (0.0ms) +Filter chain halted as :authenticate_account! rendered or redirected +Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms) +  (0.9ms) ROLLBACK +  (0.8ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendering html template + Rendered html template (0.0ms) +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms) +  (0.8ms) ROLLBACK +  (0.8ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (1.3ms) ROLLBACK +  (0.8ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:48:02.650536"], ["updated_at", "2019-07-17 03:48:02.650536"], ["synced_id", 123]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) ROLLBACK +  (0.7ms) BEGIN + Account Load (0.8ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (1.6ms) SAVEPOINT active_record_1 + Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-07-17 03:48:02.663717"], ["updated_at", "2019-07-17 03:48:02.663717"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) SAVEPOINT active_record_1 + Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-07-17 03:48:02.667733"], ["synced_id", 0], ["id", 1990]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (1.0ms) ROLLBACK +  (0.8ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.680145"], ["updated_at", "2019-07-17 03:48:02.680145"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1991], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 1991], ["LIMIT", 1]] + Account Update (0.9ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-07-17 03:48:02.687575"], ["id", 1991]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1991], ["LIMIT", 1]] +  (0.9ms) ROLLBACK +  (0.8ms) BEGIN +  (1.1ms) SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] + Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:48:02.698221"], ["updated_at", "2019-07-17 03:48:02.698221"], ["synced_id", 1]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] + Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:48:02.702971"], ["updated_at", "2019-07-17 03:48:02.702971"], ["synced_id", 2]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] + Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:48:02.707408"], ["updated_at", "2019-07-17 03:48:02.707408"], ["synced_id", 3]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:48:02.715743"], ["updated_at", "2019-07-17 03:48:02.715743"], ["synced_id", 123]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.723076"], ["updated_at", "2019-07-17 03:48:02.723076"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SELECT COUNT(*) FROM "accounts" + Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-07-17 03:48:02.729623"], ["updated_at", "2019-07-17 03:48:02.729623"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SELECT COUNT(*) FROM "accounts" +  (0.5ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.736663"], ["updated_at", "2019-07-17 03:48:02.736663"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-07-17 03:48:02.741456"], ["updated_at", "2019-07-17 03:48:02.741456"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.9ms) ROLLBACK +  (0.7ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.749882"], ["updated_at", "2019-07-17 03:48:02.749882"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.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-07-17 03:48:02.755147"], ["updated_at", "2019-07-17 03:48:02.755147"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.762731"], ["updated_at", "2019-07-17 03:48:02.762731"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-07-17 03:48:02.768429"], ["updated_at", "2019-07-17 03:48:02.768429"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.775561"], ["updated_at", "2019-07-17 03:48:02.775561"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.780478"], ["updated_at", "2019-07-17 03:48:02.780478"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2005], ["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-07-17 03:48:02.785923"], ["id", 2005]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 2005], ["LIMIT", 1]] +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.794438"], ["updated_at", "2019-07-17 03:48:02.794438"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.799345"], ["updated_at", "2019-07-17 03:48:02.799345"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.5ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2007], ["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-07-17 03:48:02.804445"], ["id", 2007]] +  (0.5ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 2007], ["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.813393"], ["updated_at", "2019-07-17 03:48:02.813393"], ["provider", "bookingsync"], ["synced_id", 456]] +  (1.4ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) SAVEPOINT active_record_1 + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (1.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.819665"], ["updated_at", "2019-07-17 03:48:02.819665"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.9ms) SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2009], ["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-07-17 03:48:02.826815"], ["id", 2009]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) ROLLBACK +  (0.8ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.834968"], ["updated_at", "2019-07-17 03:48:02.834968"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:48:02.839530"], ["updated_at", "2019-07-17 03:48:02.839530"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2011], ["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-07-17 03:48:02.844975"], ["id", 2011]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:48:02.852037"], ["updated_at", "2019-07-17 03:48:02.852037"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-07-17 03:48:02.858781"], ["updated_at", "2019-07-17 03:48:02.858781"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1563248882"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.9ms) SAVEPOINT active_record_1 + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2013], ["LIMIT", 1]] + Account Update (0.9ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-07-17 03:48:02.875117"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 2013]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-07-17 03:48:02.882607"], ["updated_at", "2019-07-17 03:48:02.882607"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1563421682"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:48:02.892491"], ["updated_at", "2019-07-17 03:48:02.892491"], ["synced_id", 123]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (1.0ms) ROLLBACK +  (0.9ms) BEGIN +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +  (0.8ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (1.0ms) ROLLBACK +  (0.8ms) BEGIN +  (0.8ms) ROLLBACK +  (0.5ms) BEGIN +  (0.9ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.6ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.host"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.4ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.450982"], ["updated_at", "2019-07-17 03:58:16.450982"], ["synced_id", 123], ["host", "example.host"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 +  (0.9ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.457318"], ["updated_at", "2019-07-17 03:58:16.457318"], ["synced_id", 123], ["host", "test.host"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "test.host"], ["synced_id", 123], ["LIMIT", 1]] +  (1.0ms) ROLLBACK +  (0.8ms) BEGIN +  (0.8ms) SAVEPOINT active_record_1 + Account Exists (1.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (2.3ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:58:16.486197"], ["updated_at", "2019-07-17 03:58:16.486197"], ["synced_id", 123]] +  (1.2ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] +  (2.8ms) ROLLBACK +  (0.9ms) BEGIN +  (0.8ms) ROLLBACK +  (1.0ms) BEGIN +  (2.0ms) SAVEPOINT active_record_1 + Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:16.533891"], ["updated_at", "2019-07-17 03:58:16.533891"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 + Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]] +  (1.1ms) ROLLBACK +  (0.7ms) BEGIN +  (0.8ms) SAVEPOINT active_record_1 + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:16.564207"], ["updated_at", "2019-07-17 03:58:16.564207"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (1.0ms) RELEASE SAVEPOINT active_record_1 + Application Load (1.0ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "ABC"], ["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] +  (1.2ms) ROLLBACK +  (0.9ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:16.602734"], ["updated_at", "2019-07-17 03:58:16.602734"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]] +  (1.0ms) ROLLBACK +  (0.9ms) BEGIN +  (0.8ms) SAVEPOINT active_record_1 + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (1.0ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:16.624636"], ["updated_at", "2019-07-17 03:58:16.624636"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" IS NULL LIMIT $1 [["LIMIT", 1]] + Application Exists (1.6ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" IS NULL LIMIT $1 [["LIMIT", 1]] +  (1.6ms) ROLLBACK +  (1.1ms) BEGIN +  (1.2ms) 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 (2.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (2.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (1.6ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:16.664019"], ["updated_at", "2019-07-17 03:58:16.664019"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (1.1ms) RELEASE SAVEPOINT active_record_1 + Application Load (1.3ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] + Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "TEST.HOST"], ["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] +  (1.4ms) ROLLBACK +  (1.3ms) BEGIN +  (1.4ms) SAVEPOINT active_record_1 + Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Create (1.4ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:16.702264"], ["updated_at", "2019-07-17 03:58:16.702264"], ["host", "test.host"], ["client_id", "abc"], ["client_secret", "def"]] +  (1.1ms) RELEASE SAVEPOINT active_record_1 + Application Load (1.2ms) SELECT "applications".* FROM "applications" ORDER BY "applications"."id" ASC LIMIT $1 [["LIMIT", 1]] + Application Exists (1.4ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "def"], ["LIMIT", 1]] + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.host"], ["LIMIT", 1]] + Application Exists (1.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "abc"], ["LIMIT", 1]] + Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "DEF"], ["LIMIT", 1]] +  (0.9ms) ROLLBACK +  (1.0ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (0.9ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (1.0ms) SAVEPOINT active_record_1 + Account Exists (1.3ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (1.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-07-17 03:58:16.736665"], ["updated_at", "2019-07-17 03:58:16.736665"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (1.2ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 11ms (ActiveRecord: 5.9ms) +  (1.2ms) ROLLBACK +  (1.0ms) BEGIN +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (1.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (1.5ms) SAVEPOINT active_record_1 + Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (1.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-07-17 03:58:16.755306"], ["updated_at", "2019-07-17 03:58:16.755306"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (1.4ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/admin +Completed 302 Found in 12ms (ActiveRecord: 7.8ms) +  (1.5ms) ROLLBACK +  (1.2ms) BEGIN +  (1.4ms) SELECT COUNT(*) FROM "accounts" +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.8ms) SAVEPOINT active_record_1 + Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-07-17 03:58:16.778107"], ["updated_at", "2019-07-17 03:58:16.778107"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 7ms (ActiveRecord: 5.0ms) +  (1.2ms) SELECT COUNT(*) FROM "accounts" + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] +  (1.0ms) ROLLBACK +  (0.7ms) BEGIN +  (1.1ms) SELECT COUNT(*) FROM "multi_applications_accounts" +Processing by SessionsController#create as HTML + Parameters: {"provider"=>"bookingsync"} + MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "test.host"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.host"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.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-07-17 03:58:16.796965"], ["updated_at", "2019-07-17 03:58:16.796965"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "test.host"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +Redirected to http://test.host/ +Completed 302 Found in 9ms (ActiveRecord: 4.9ms) +  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" + MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] + MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" DESC LIMIT $1 [["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/ +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.8ms) ROLLBACK +  (0.7ms) BEGIN +Processing by SessionsController#destroy as HTML +Redirected to http://test.host/signed_out +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. + Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 6ms (Views: 3.0ms | ActiveRecord: 0.0ms) +  (1.2ms) ROLLBACK +  (0.8ms) BEGIN +Processing by SessionsController#failure as HTML + Rendering /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. + Rendered /Users/marc/Projects/bookingsync-engine/app/views/sessions/failure.html.erb within layouts/application (0.2ms) + Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary. +Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms) +  (0.8ms) ROLLBACK +  (0.9ms) BEGIN +  (1.1ms) SAVEPOINT active_record_1 + Application Exists (1.1ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] + Application Exists (1.0ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] + Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:16.840878"], ["updated_at", "2019-07-17 03:58:16.840878"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (1.0ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +Processing by AuthenticatedController#index as HTML + Rendering html template + Rendered html template (0.0ms) +Filter chain halted as :authenticate_account! rendered or redirected +Completed 200 OK in 1ms (Views: 1.1ms | ActiveRecord: 0.0ms) +  (0.8ms) ROLLBACK +  (0.8ms) BEGIN +Processing by AuthenticatedController#index as HTML +Redirected to http://test.host/auth/bookingsync/?account_id= +Filter chain halted as :authenticate_account! rendered or redirected +Completed 302 Found in 0ms (ActiveRecord: 0.0ms) +  (0.8ms) ROLLBACK +  (0.6ms) BEGIN +Processing by AuthenticatedController#index as JS + Rendering text template + Rendered text template (0.0ms) +Filter chain halted as :authenticate_account! rendered or redirected +Completed 401 Unauthorized in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms) +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +Processing by AuthenticatedController#index as JS + Rendering text template + Rendered text template (0.0ms) +Filter chain halted as :authenticate_account! rendered or redirected +Completed 401 Unauthorized in 0ms (Views: 0.2ms | ActiveRecord: 0.0ms) +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + Account Create (1.1ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:16.883448"], ["updated_at", "2019-07-17 03:58:16.883448"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 2020], ["LIMIT", 1]] +  (0.5ms) SAVEPOINT active_record_1 + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL AND "accounts"."id" != $1 LIMIT $2 [["id", 2020], ["LIMIT", 1]] + Account Update (0.9ms) UPDATE "accounts" SET "oauth_access_token" = $1, "oauth_refresh_token" = $2, "oauth_expires_at" = $3, "updated_at" = $4 WHERE "accounts"."id" = $5 [["oauth_access_token", nil], ["oauth_refresh_token", nil], ["oauth_expires_at", nil], ["updated_at", "2019-07-17 03:58:16.893249"], ["id", 2020]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 2020], ["LIMIT", 1]] +  (0.8ms) ROLLBACK +  (0.6ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.901900"], ["updated_at", "2019-07-17 03:58:16.901900"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.905981"], ["updated_at", "2019-07-17 03:58:16.905981"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2022], ["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-07-17 03:58:16.911186"], ["id", 2022]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) ROLLBACK +  (0.8ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.919258"], ["updated_at", "2019-07-17 03:58:16.919258"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.923456"], ["updated_at", "2019-07-17 03:58:16.923456"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.7ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2024], ["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-07-17 03:58:16.928663"], ["id", 2024]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 2024], ["LIMIT", 1]] +  (0.8ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.937971"], ["updated_at", "2019-07-17 03:58:16.937971"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.942073"], ["updated_at", "2019-07-17 03:58:16.942073"], ["provider", "bookingsync"], ["synced_id", 123]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (1.2ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2026], ["LIMIT", 1]] + Account Update (1.5ms) UPDATE "accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-07-17 03:58:16.947740"], ["id", 2026]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 2026], ["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.5ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.957934"], ["updated_at", "2019-07-17 03:58:16.957934"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.962113"], ["updated_at", "2019-07-17 03:58:16.962113"], ["provider", "bookingsync"], ["synced_id", 123]] +  (1.0ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2028], ["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-07-17 03:58:16.968762"], ["id", 2028]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (1.6ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.977279"], ["updated_at", "2019-07-17 03:58:16.977279"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (1.4ms) SELECT COUNT(*) FROM "accounts" + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (1.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-07-17 03:58:16.985252"], ["updated_at", "2019-07-17 03:58:16.985252"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) SELECT COUNT(*) FROM "accounts" +  (0.8ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:16.994678"], ["updated_at", "2019-07-17 03:58:16.994678"], ["provider", "bookingsync"], ["synced_id", 456]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.1ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.8ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-07-17 03:58:17.000585"], ["updated_at", "2019-07-17 03:58:17.000585"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.9ms) ROLLBACK +  (1.4ms) BEGIN +  (1.1ms) SAVEPOINT active_record_1 + Account Exists (2.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (1.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:17.012464"], ["updated_at", "2019-07-17 03:58:17.012464"], ["provider", "bookingsync"], ["synced_id", 456]] +  (2.0ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.6ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."provider" = $2 LIMIT $3 [["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (1.5ms) SAVEPOINT active_record_1 + Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (2.2ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-07-17 03:58:17.025083"], ["updated_at", "2019-07-17 03:58:17.025083"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (1.4ms) RELEASE SAVEPOINT active_record_1 +  (1.5ms) ROLLBACK +  (3.0ms) BEGIN +  (1.3ms) SAVEPOINT active_record_1 + Account Exists (1.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 456], ["LIMIT", 1]] + Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:17.042061"], ["updated_at", "2019-07-17 03:58:17.042061"], ["provider", "bookingsync"], ["synced_id", 456]] +  (2.1ms) 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]] +  (4.2ms) SAVEPOINT active_record_1 + Account Exists (3.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (2.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2019-07-17 03:58:17.063635"], ["updated_at", "2019-07-17 03:58:17.063635"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"]] +  (1.3ms) RELEASE SAVEPOINT active_record_1 +  (1.2ms) ROLLBACK +  (1.1ms) BEGIN +  (1.0ms) SAVEPOINT active_record_1 + Account Exists (1.5ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (1.4ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:58:17.076538"], ["updated_at", "2019-07-17 03:58:17.076538"], ["synced_id", 123]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 +  (1.5ms) ROLLBACK +  (1.2ms) BEGIN +  (1.2ms) ROLLBACK +  (0.7ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.7ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:58:17.112292"], ["updated_at", "2019-07-17 03:58:17.112292"], ["synced_id", 123]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (1.0ms) ROLLBACK +  (0.5ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:58:17.119889"], ["updated_at", "2019-07-17 03:58:17.119889"], ["synced_id", 123]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (1.3ms) ROLLBACK +  (0.7ms) BEGIN +  (0.8ms) SAVEPOINT active_record_1 + Account Exists (1.0ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-07-17 03:58:17.143914"], ["updated_at", "2019-07-17 03:58:17.143914"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1563249497"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (1.3ms) SAVEPOINT active_record_1 + Account Exists (1.1ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 AND "accounts"."id" != $2 LIMIT $3 [["synced_id", 123], ["id", 2040], ["LIMIT", 1]] + Account Update (1.2ms) UPDATE "accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "accounts"."id" = $4 [["updated_at", "2019-07-17 03:58:17.161206"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 2040]] +  (1.0ms) RELEASE SAVEPOINT active_record_1 +  (1.2ms) ROLLBACK +  (0.7ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 123], ["LIMIT", 1]] + Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-07-17 03:58:17.169907"], ["updated_at", "2019-07-17 03:58:17.169907"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1563422297"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 1], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:58:17.176994"], ["updated_at", "2019-07-17 03:58:17.176994"], ["synced_id", 1]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.8ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 2], ["LIMIT", 1]] + Account Create (0.9ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:58:17.180662"], ["updated_at", "2019-07-17 03:58:17.180662"], ["synced_id", 2]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Account Exists (0.7ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] + Account Create (0.8ms) INSERT INTO "accounts" ("created_at", "updated_at", "synced_id") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2019-07-17 03:58:17.184688"], ["updated_at", "2019-07-17 03:58:17.184688"], ["synced_id", 3]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 + Account Load (1.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 3], ["LIMIT", 1]] +  (1.0ms) ROLLBACK +  (0.7ms) BEGIN +  (0.9ms) SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" IS NULL LIMIT $1 [["LIMIT", 1]] + Account Create (1.0ms) INSERT INTO "accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.193986"], ["updated_at", "2019-07-17 03:58:17.193986"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.9ms) ROLLBACK +  (0.8ms) BEGIN + Account Load (0.9ms) SELECT "accounts".* FROM "accounts" ORDER BY "accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] +  (1.0ms) SAVEPOINT active_record_1 + Account Create (1.6ms) INSERT INTO "accounts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-07-17 03:58:17.208690"], ["updated_at", "2019-07-17 03:58:17.208690"]] +  (1.2ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) SAVEPOINT active_record_1 + Account Update (1.5ms) UPDATE "accounts" SET "updated_at" = $1, "synced_id" = $2 WHERE "accounts"."id" = $3 [["updated_at", "2019-07-17 03:58:17.213782"], ["synced_id", 0], ["id", 2046]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + Account Exists (0.9ms) SELECT 1 AS one FROM "accounts" WHERE "accounts"."synced_id" = $1 LIMIT $2 [["synced_id", 0], ["LIMIT", 1]] +  (0.9ms) ROLLBACK +  (0.8ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.2ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:17.226735"], ["updated_at", "2019-07-17 03:58:17.226735"], ["synced_id", 123], ["host", "test.example"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) SAVEPOINT active_record_1 + Application Exists (1.5ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] + Application Create (1.2ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.236822"], ["updated_at", "2019-07-17 03:58:17.236822"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 + Application Load (1.2ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] +  (1.0ms) ROLLBACK +  (0.7ms) BEGIN +  (0.8ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.5ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.258792"], ["updated_at", "2019-07-17 03:58:17.258792"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" ORDER BY "multi_applications_accounts"."id" ASC LIMIT $1 [["LIMIT", 1]] + MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" + MultiApplicationsAccount Exists (1.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.tesu"], ["LIMIT", 1]] +  (1.5ms) ROLLBACK +  (1.3ms) BEGIN +  (1.1ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (2.7ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "test.example"], ["LIMIT", 1]] + MultiApplicationsAccount Create (2.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:17.284022"], ["updated_at", "2019-07-17 03:58:17.284022"], ["synced_id", 123], ["host", "test.example"]] +  (1.2ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) SAVEPOINT active_record_1 + Application Exists (1.3ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] + Application Exists (1.2ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] + Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] + Application Create (0.9ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.295122"], ["updated_at", "2019-07-17 03:58:17.295122"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.9ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] +  (0.9ms) ROLLBACK +  (0.8ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "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-07-17 03:58:17.304514"], ["updated_at", "2019-07-17 03:58:17.304514"], ["synced_id", 123], ["host", "test.example"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] + Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.310880"], ["updated_at", "2019-07-17 03:58:17.310880"], ["host", "test.example"], ["client_id", "123"], ["client_secret", "456"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test2.example"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "234"], ["LIMIT", 1]] + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "567"], ["LIMIT", 1]] + Application Create (0.7ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.317170"], ["updated_at", "2019-07-17 03:58:17.317170"], ["host", "test2.example"], ["client_id", "234"], ["client_secret", "567"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "test.example"], ["LIMIT", 1]] +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.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-07-17 03:58:17.325259"], ["updated_at", "2019-07-17 03:58:17.325259"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2214], ["LIMIT", 1]] +  (1.0ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."id" != $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["id", 2214], ["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-07-17 03:58:17.333219"], ["id", 2214]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2214], ["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "client_id"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "client_secret"], ["LIMIT", 1]] + Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.344687"], ["updated_at", "2019-07-17 03:58:17.344687"], ["host", "host"], ["client_id", "client_id"], ["client_secret", "client_secret"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Application Load (1.1ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "host"], ["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.354317"], ["updated_at", "2019-07-17 03:58:17.354317"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.358881"], ["updated_at", "2019-07-17 03:58:17.358881"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (1.4ms) ROLLBACK +  (0.8ms) BEGIN +  (0.9ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.371846"], ["updated_at", "2019-07-17 03:58:17.371846"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.376685"], ["updated_at", "2019-07-17 03:58:17.376685"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (1.4ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.4ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2217], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Update (1.4ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-07-17 03:58:17.384323"], ["id", 2217]] +  (1.3ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.394307"], ["updated_at", "2019-07-17 03:58:17.394307"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.2ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $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-07-17 03:58:17.399919"], ["updated_at", "2019-07-17 03:58:17.399919"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2219], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-07-17 03:58:17.406374"], ["id", 2219]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2219], ["LIMIT", 1]] +  (0.8ms) ROLLBACK +  (0.6ms) BEGIN +  (1.0ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.416417"], ["updated_at", "2019-07-17 03:58:17.416417"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.421190"], ["updated_at", "2019-07-17 03:58:17.421190"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (1.0ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.8ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2221], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Update (0.9ms) UPDATE "multi_applications_accounts" SET "name" = $1, "oauth_access_token" = $2, "oauth_refresh_token" = $3, "oauth_expires_at" = $4, "updated_at" = $5 WHERE "multi_applications_accounts"."id" = $6 [["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["updated_at", "2019-07-17 03:58:17.427756"], ["id", 2221]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."id" = $1 LIMIT $2 [["id", 2221], ["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.436654"], ["updated_at", "2019-07-17 03:58:17.436654"], ["provider", "bookingsync"], ["synced_id", 123], ["host", "example.test"]] +  (1.1ms) RELEASE SAVEPOINT active_record_1 +  (0.5ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.441090"], ["updated_at", "2019-07-17 03:58:17.441090"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" + MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_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-07-17 03:58:17.447425"], ["updated_at", "2019-07-17 03:58:17.447425"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) SELECT COUNT(*) FROM "multi_applications_accounts" +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN + MultiApplicationsAccount Load (0.9ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-07-17 03:58:17.457312"], ["updated_at", "2019-07-17 03:58:17.457312"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.462363"], ["updated_at", "2019-07-17 03:58:17.462363"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) ROLLBACK +  (0.6ms) BEGIN + MultiApplicationsAccount Load (0.7ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.8ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "name", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["created_at", "2019-07-17 03:58:17.471672"], ["updated_at", "2019-07-17 03:58:17.471672"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.9ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.476051"], ["updated_at", "2019-07-17 03:58:17.476051"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.8ms) ROLLBACK +  (0.9ms) BEGIN + MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 AND "multi_applications_accounts"."provider" = $3 LIMIT $4 [["host", "example3.test"], ["synced_id", 123], ["provider", "bookingsync"], ["LIMIT", 1]] +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example3.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.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-07-17 03:58:17.484841"], ["updated_at", "2019-07-17 03:58:17.484841"], ["provider", "bookingsync"], ["synced_id", 123], ["name", "business name"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh token"], ["oauth_expires_at", "expires at"], ["host", "example3.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 456], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "provider", "synced_id", "host") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.489188"], ["updated_at", "2019-07-17 03:58:17.489188"], ["provider", "bookingsync"], ["synced_id", 456], ["host", "example2.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.0ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (1.0ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:17.497095"], ["updated_at", "2019-07-17 03:58:17.497095"], ["synced_id", 1], ["host", "example.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:17.501551"], ["updated_at", "2019-07-17 03:58:17.501551"], ["synced_id", 2], ["host", "example.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 1], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:17.505753"], ["updated_at", "2019-07-17 03:58:17.505753"], ["synced_id", 1], ["host", "example2.test"]] +  (0.5ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 2], ["host", "example2.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "host") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2019-07-17 03:58:17.509742"], ["updated_at", "2019-07-17 03:58:17.509742"], ["synced_id", 2], ["host", "example2.test"]] +  (0.8ms) RELEASE SAVEPOINT active_record_1 + MultiApplicationsAccount Load (0.8ms) SELECT "multi_applications_accounts".* FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."host" = $1 AND "multi_applications_accounts"."synced_id" = $2 LIMIT $3 [["host", "example2.test"], ["synced_id", 1], ["LIMIT", 1]] +  (0.8ms) ROLLBACK +  (0.7ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" IS NULL AND "multi_applications_accounts"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.8ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", "2019-07-17 03:58:17.518521"], ["updated_at", "2019-07-17 03:58:17.518521"], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh"], ["oauth_expires_at", "expires"], ["host", "example.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.9ms) INSERT INTO "multi_applications_accounts" ("created_at", "updated_at", "synced_id", "oauth_access_token", "oauth_refresh_token", "oauth_expires_at", "host") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", "2019-07-17 03:58:17.525716"], ["updated_at", "2019-07-17 03:58:17.525716"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1563422297"], ["host", "example.test"]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] + Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.532091"], ["updated_at", "2019-07-17 03:58:17.532091"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.7ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] +  (0.7ms) ROLLBACK +  (0.5ms) BEGIN +  (0.6ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (0.8ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."host" = $2 LIMIT $3 [["synced_id", 123], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Create (0.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-07-17 03:58:17.540193"], ["updated_at", "2019-07-17 03:58:17.540193"], ["synced_id", 123], ["oauth_access_token", "token"], ["oauth_refresh_token", "refresh_token"], ["oauth_expires_at", "1563249497"], ["host", "example.test"]] +  (0.6ms) RELEASE SAVEPOINT active_record_1 +  (0.6ms) SAVEPOINT active_record_1 + Application Exists (0.8ms) SELECT 1 AS one FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] + Application Exists (0.7ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_id" = $1 LIMIT $2 [["client_id", "123"], ["LIMIT", 1]] + Application Exists (0.9ms) SELECT 1 AS one FROM "applications" WHERE "applications"."client_secret" = $1 LIMIT $2 [["client_secret", "456"], ["LIMIT", 1]] + Application Create (0.8ms) INSERT INTO "applications" ("created_at", "updated_at", "host", "client_id", "client_secret") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2019-07-17 03:58:17.546609"], ["updated_at", "2019-07-17 03:58:17.546609"], ["host", "example.test"], ["client_id", "123"], ["client_secret", "456"]] +  (0.9ms) RELEASE SAVEPOINT active_record_1 + Application Load (0.8ms) SELECT "applications".* FROM "applications" WHERE "applications"."host" = $1 LIMIT $2 [["host", "example.test"], ["LIMIT", 1]] +  (1.0ms) SAVEPOINT active_record_1 + MultiApplicationsAccount Exists (1.1ms) SELECT 1 AS one FROM "multi_applications_accounts" WHERE "multi_applications_accounts"."synced_id" = $1 AND "multi_applications_accounts"."id" != $2 AND "multi_applications_accounts"."host" = $3 LIMIT $4 [["synced_id", 123], ["id", 2238], ["host", "example.test"], ["LIMIT", 1]] + MultiApplicationsAccount Update (1.0ms) UPDATE "multi_applications_accounts" SET "updated_at" = $1, "oauth_access_token" = $2, "oauth_expires_at" = $3 WHERE "multi_applications_accounts"."id" = $4 [["updated_at", "2019-07-17 03:58:17.564031"], ["oauth_access_token", "refreshed_token"], ["oauth_expires_at", nil], ["id", 2238]] +  (0.7ms) RELEASE SAVEPOINT active_record_1 +  (0.7ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) ROLLBACK +  (0.6ms) BEGIN +  (0.6ms) ROLLBACK +  (0.7ms) BEGIN +  (0.8ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) ROLLBACK +  (0.7ms) BEGIN +  (0.7ms) ROLLBACK